{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ea04d52f",
   "metadata": {},
   "source": [
    "# Python数据分析—泰坦尼克船员数据案例"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5661ddeb",
   "metadata": {},
   "source": [
    "### 数据准备：\n",
    "\n",
    "码云：https://gitee.com/Code_Knight319/Python-data-analysis-Machine-Learning-deep-learning-tutorial-source-code/tree/master/python%E5%85%A5%E9%97%A8%E5%9F%BA%E7%A1%80/seaborn-data\n",
    "    \n",
    "或者\n",
    "\n",
    "Titanic Data Set from Kaggle (https://www.kaggle.com/c/titanic)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "22444c48",
   "metadata": {},
   "source": [
    "### 导入函数库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 285,
   "id": "58792adc",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8f81d90c",
   "metadata": {},
   "source": [
    "### Step1：读取数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 286,
   "id": "23272f43",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_csv('./seaborn-data/titanic.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 287,
   "id": "2f8b9a2f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>adult_male</th>\n",
       "      <th>deck</th>\n",
       "      <th>embark_town</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>Second</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>B</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>23.4500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>C</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>32.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>Q</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Queenstown</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 15 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass     sex   age  sibsp  parch     fare embarked   class  \\\n",
       "0           0       3    male  22.0      1      0   7.2500        S   Third   \n",
       "1           1       1  female  38.0      1      0  71.2833        C   First   \n",
       "2           1       3  female  26.0      0      0   7.9250        S   Third   \n",
       "3           1       1  female  35.0      1      0  53.1000        S   First   \n",
       "4           0       3    male  35.0      0      0   8.0500        S   Third   \n",
       "..        ...     ...     ...   ...    ...    ...      ...      ...     ...   \n",
       "886         0       2    male  27.0      0      0  13.0000        S  Second   \n",
       "887         1       1  female  19.0      0      0  30.0000        S   First   \n",
       "888         0       3  female   NaN      1      2  23.4500        S   Third   \n",
       "889         1       1    male  26.0      0      0  30.0000        C   First   \n",
       "890         0       3    male  32.0      0      0   7.7500        Q   Third   \n",
       "\n",
       "       who  adult_male deck  embark_town alive  alone  \n",
       "0      man        True  NaN  Southampton    no  False  \n",
       "1    woman       False    C    Cherbourg   yes  False  \n",
       "2    woman       False  NaN  Southampton   yes   True  \n",
       "3    woman       False    C  Southampton   yes  False  \n",
       "4      man        True  NaN  Southampton    no   True  \n",
       "..     ...         ...  ...          ...   ...    ...  \n",
       "886    man        True  NaN  Southampton    no   True  \n",
       "887  woman       False    B  Southampton   yes   True  \n",
       "888  woman       False  NaN  Southampton    no  False  \n",
       "889    man        True    C    Cherbourg   yes   True  \n",
       "890    man        True  NaN   Queenstown    no   True  \n",
       "\n",
       "[891 rows x 15 columns]"
      ]
     },
     "execution_count": 287,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "591764cd",
   "metadata": {},
   "source": [
    "#### 分析各列信息：\n",
    "\n",
    "`\\t`survived`\\t`pclass`\\t`sex`\\t`age`\\t`sibsp`\\t`parch`\\t`fare`\\t`embarked`\\t`class`\\t`who`\\t`adult_male`\\t`deck`\\t`embark_town`\\t`alive`\\t`alone\n",
    "\n",
    "`\\t`幸存`\\t`船舱等级`\\t`性别`\\t`年龄`\\t`兄弟姐妹数`\\t`父母子女数`\\t`票价`\\t`登船港口`\\t`船舱等级`\\t`姓名`\\t`成年男性`\\t`甲板号`\\t`登船城市`\\t` 存活`\\t`独自一人"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2ad2596f",
   "metadata": {},
   "source": [
    "### Step2： 数据分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 288,
   "id": "3f3f335b",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>adult_male</th>\n",
       "      <th>deck</th>\n",
       "      <th>embark_town</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>Second</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>B</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>23.4500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>C</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>32.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>Q</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Queenstown</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 15 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass     sex   age  sibsp  parch     fare embarked   class  \\\n",
       "0           0       3    male  22.0      1      0   7.2500        S   Third   \n",
       "1           1       1  female  38.0      1      0  71.2833        C   First   \n",
       "2           1       3  female  26.0      0      0   7.9250        S   Third   \n",
       "3           1       1  female  35.0      1      0  53.1000        S   First   \n",
       "4           0       3    male  35.0      0      0   8.0500        S   Third   \n",
       "..        ...     ...     ...   ...    ...    ...      ...      ...     ...   \n",
       "886         0       2    male  27.0      0      0  13.0000        S  Second   \n",
       "887         1       1  female  19.0      0      0  30.0000        S   First   \n",
       "888         0       3  female   NaN      1      2  23.4500        S   Third   \n",
       "889         1       1    male  26.0      0      0  30.0000        C   First   \n",
       "890         0       3    male  32.0      0      0   7.7500        Q   Third   \n",
       "\n",
       "       who  adult_male deck  embark_town alive  alone  \n",
       "0      man        True  NaN  Southampton    no  False  \n",
       "1    woman       False    C    Cherbourg   yes  False  \n",
       "2    woman       False  NaN  Southampton   yes   True  \n",
       "3    woman       False    C  Southampton   yes  False  \n",
       "4      man        True  NaN  Southampton    no   True  \n",
       "..     ...         ...  ...          ...   ...    ...  \n",
       "886    man        True  NaN  Southampton    no   True  \n",
       "887  woman       False    B  Southampton   yes   True  \n",
       "888  woman       False  NaN  Southampton    no  False  \n",
       "889    man        True    C    Cherbourg   yes   True  \n",
       "890    man        True  NaN   Queenstown    no   True  \n",
       "\n",
       "[891 rows x 15 columns]"
      ]
     },
     "execution_count": 288,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 289,
   "id": "5c3a2536",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(891, 15)"
      ]
     },
     "execution_count": 289,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 290,
   "id": "64b1b493",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='survived', ylabel='count'>"
      ]
     },
     "execution_count": 290,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEECAYAAAAlEzNMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAATGElEQVR4nO3dcWzUd/3H8df3rlyB65WuWUnUcqQFGpnzbKVplzTUETcPk+k2LAVuHi4THSRGW4UV5mjVzLWEWHWYbXHBIcfmWQdzxGCi1LomRWvSbDDrqkuDbCLBOtZxd8xruX5/fxgr/Ebbw973rtvn+fir971vv/c+8s09+X7v7lvLtm1bAABjuXI9AAAgtwgBABiOE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UrtXLlylyPAVw3QgDjnT59Wrt27VJeXp7cbrc+85nPqKenR9/97nclSXV1derr69POnTs1Ojqq0dFRlZWVqaamRnfffbdGRkZ0//33q6WlRdFoVHfccYeOHz+u9vZ2SdJdd92l/fv36w9/+IMOHDggl8ulVatWafv27frHP/6h7du3y7ZtlZSU5PKfAQbj1BCMd+LECX3oQx/SU089pa1bt+rixYtTrnvLLbcoGo1qy5Yteu655yRJzz//vNatWze5zq233qoXX3xRly5d0qlTp+T3++V2u7Vv3z4dOHBAP/nJT3T+/Hn19fXpqaee0h133KFIJKLbbrvN8ecKXAshgPEaGhp0ww03aMuWLXr66afldruvuv/KL9+XlZVJkpYtW6ZUKqWzZ8/q2LFj+vSnPz25jtvtVjAY1K9+9SsdOXJE69ev12uvvaYLFy7oi1/8osLhsIaHh/X666/r1VdfVSAQkPTva0ABuUAIYLzu7m6tWrVKP/7xj7V27VodO3ZMIyMjkqSzZ8/qrbfemlzXsqzJnxsaGrR3714tX75chYWFV22zoaFBR48e1cmTJ1VXV6fS0lK9733v049+9CNFIhF99rOf1Uc+8hGVl5frxRdflCS9/PLLWXi2wDvxHgGMd/PNN2vHjh3at2+fXC6XHnjgAT3++ONav369li1bptLS0mv+3tq1a/Xtb3/7mn/dbcmSJZKkj3/843K5XCouLta9996rcDisVCqlD3zgA/rkJz+pr3zlK2pubtaxY8emfBzAaVx0DgAMx6khADAcIQAAwxECADAcIQAAwxECADAcIQAAwxECADDc/wEnMxQv5KDAFQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#统计存活人数\n",
    "sns.set_style('darkgrid')#style : dict, or one of {darkgrid, whitegrid, dark, white, ticks}\n",
    "sns.countplot(x='survived',data=data)#Show the counts of observations in each categorical bin using bars."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 291,
   "id": "c008c2bc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    549\n",
       "1    342\n",
       "Name: survived, dtype: int64"
      ]
     },
     "execution_count": 291,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#统计存活人数\n",
    "data['survived'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 292,
   "id": "2719d09f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>342.0</td>\n",
       "      <td>342.000000</td>\n",
       "      <td>290.000000</td>\n",
       "      <td>342.000000</td>\n",
       "      <td>342.000000</td>\n",
       "      <td>342.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.950292</td>\n",
       "      <td>28.343690</td>\n",
       "      <td>0.473684</td>\n",
       "      <td>0.464912</td>\n",
       "      <td>48.395408</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.863321</td>\n",
       "      <td>14.950952</td>\n",
       "      <td>0.708688</td>\n",
       "      <td>0.771712</td>\n",
       "      <td>66.596998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.420000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>19.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>12.475000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>28.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>26.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>1.0</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>36.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>57.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>1.0</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>80.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>512.329200</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       survived      pclass         age       sibsp       parch        fare\n",
       "count     342.0  342.000000  290.000000  342.000000  342.000000  342.000000\n",
       "mean        1.0    1.950292   28.343690    0.473684    0.464912   48.395408\n",
       "std         0.0    0.863321   14.950952    0.708688    0.771712   66.596998\n",
       "min         1.0    1.000000    0.420000    0.000000    0.000000    0.000000\n",
       "25%         1.0    1.000000   19.000000    0.000000    0.000000   12.475000\n",
       "50%         1.0    2.000000   28.000000    0.000000    0.000000   26.000000\n",
       "75%         1.0    3.000000   36.000000    1.000000    1.000000   57.000000\n",
       "max         1.0    3.000000   80.000000    4.000000    5.000000  512.329200"
      ]
     },
     "execution_count": 292,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[data['survived']==1].describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 293,
   "id": "39e36eb5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='survived', ylabel='count'>"
      ]
     },
     "execution_count": 293,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEECAYAAAAlEzNMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAXJElEQVR4nO3df3TT9b3H8dc3CSmYtkBH/TEhQKFVkNVWO9pzOXCsPyg7x+lUft26OqdctY5pmfwoCgUn0iJaf+AFlYFohxYmqLiDx0FhdCujm1wEZeBcZQgMtWIrTaptk37vH7pKjxSL5Af083z81TTJN+/mtHn2+03yiWXbti0AgLEc0R4AABBdhAAADEcIAMBwhAAADEcIAMBwrmgPcLJaW1sVDPJCJwA4Gd26OTs874wLQTBoq76+MdpjAMAZJTExrsPzODQEAIYjBABgOEIAAIY7454jAICOBIMB1dXVKhBojvYoUeNyudW7d6Kczs4/vBMCAF1GXV2tunc/Sx7PubIsK9rjRJxt2/L7j6qurlZ9+pzX6etxaAhAlxEINMvjiTcyApJkWZY8nviT3iMiBAC6FFMj8B/f5ecnBABgOEIAAIYz8sniuN5nqbur47dbm+SLQFANdbxTGzCZkSHo7nLq8m3boj3GaWFTVpYaoj0EcAb54IP9mj//frlcLjmdTs2adb/WrFmtnTv/T62ttiZMuFGjRl2myZNv089//j9KTk7RXXfl65FHntA555wb7fGPy8gQAMB39be/VeuCCy7UL3/5K+3cuUNbtmzS4cOHtGTJcjU1Nen223+uH/4wU3PmzNP06QX63vf66Be/uPu0jYBECADgpFx99bVaufI53XPPL+XxxCo5OUXvvrtXkyffJkkKBAL68MPDSk5OUWpqmt55521lZf1XlKc+MZ4sBoCT8Oc/b9HFF6fr8ceXKDv7Cq1f/5rS0zP05JPP6IknntLll1+p888/X++887bef79GaWnpevHF30Z77BNijwAATsKFFw7Vr389W06nUw6HQw88sEAbNryuO++cpM8/b9SoUdlqbbVVUvKA5s9fqHPOOVe33XazLrnkUl144dBoj39clm3bZ9SnvLS0BE/58wgSE+N4svgrm7KyVFvL08XoGj78cL/OPbd/tMeIuuPdD3weAQCgQ4QAAAxHCADAcIQAAAxHCADAcLx8FECXFep1xbrq2lyEAECXFep1xcKxNtf69a9p//5/KT//lyHecudxaAgADMceAQCEyPr1r6mqqlJNTU06cuQTjRv33/rTn7Zo374a/eIXd+vjjz/Sli2bFQgEFBsbqwcfXNju+i+9VK4NG96QZVm64orRGjduYkTmJgQAEEKNjY169NH/1caNb2jVqhf0zDMrtGPHdq1atVIXXDBEjz22WA6HQ7/61WTt2bO77Xr79r2viooNWrz4N7IsSwUFdyozM0te74Cwz0wIACCEkpMvkCTFxsZpwICBsixLcXFxamkJqFu3bpo79z716NFDH3/8sQKBQNv13n+/Rh999KHuvjtfktTQ0KCDBw8SAgA403T04fGBQIsqK/+opUuf0xdffKFbb/1pu/O93v4aMCBJjzzyhCzL0qpVK5WUNDgSIxMCAF3XF4GgNmVlhXR735XT6VSPHj106615cru76Xvf66NPPqltOz85OUUZGT/UnXfequbmFg0ZcpESExNDMfa3YvVRw7H6KLoSVh/9EquPAgBOCiEAAMMRAgAwHCEAAMMRAgAwHC8fBdBl9e7dXS5Xt5BtLxBoUV3dFyHb3ukibCE4cuSIrr/+ei1fvlwul0uFhYWyLEvJycmaM2eOHA6HVq9erfLycrlcLuXn5ys7Oztc4wAwkMvVTW/uejhk28tInSqp4xAEg0FNm3a3Pv/8cy1Y8Kji4+NDcrvXXJOjdeveCMm2jicsh4ZaWlpUVFSk7t27S5KKi4tVUFCgF154QbZtq6KiQrW1tSorK1N5ebmWLVum0tJSNTc3h2McAIiII0c+UX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ZZdqxY4caGxu1a9cueb1eOZ1OLVq0SCtWrNCLL76ojz76SFVVVXr22Wd19dVXq6ysTFdeeWXYf1bgeAgBjDd27Fj17t1bkyZN0sqVK+V0Otudf+yb7wcOHChJGjRokILBoA4dOqT169frmmuuabuM0+lUTk6O/vCHP2jt2rUaN26cPvjgA3366ae67bbblJeXp5qaGh04cEDvvfeeUlNTJX25BhQQDYQAxquoqNCll16q5557TmPGjNH69etVW1srSTp06JA+++yztstaltX29dixY7Vw4UINHjxY8fHx7bY5duxYrVu3Tjt37tSIESPUt29fnXfeeVq+fLnKysr005/+VBdffLGSkpK0Y8cOSdLbb78dgZ8W+CaeI4Dxhg0bpmnTpmnRokVyOByaPn26lixZonHjxmnQoEHq27fvca83ZswYPfjgg8f9dLd+/fpJkq644go5HA4lJCTo5ptvVl5enoLBoM4//3z96Ec/0t13360pU6Zo/fr1Hd4OEG4sOgcAhuPQEAAYjhAAgOEIAQAYjhAAgOEIAQAYjhAAgOEIAQAY7v8BpJS93L6BX8EAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#分析死亡人数的男女比例\n",
    "sns.set_style('darkgrid')#style : dict, or one of {darkgrid, whitegrid, dark, white, ticks}\n",
    "sns.countplot(x='survived', hue=\"sex\",data=data,palette='rainbow')#Show the counts of observations in each categorical bin using bars."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 294,
   "id": "e95f05b9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "female    233\n",
       "male      109\n",
       "Name: sex, dtype: int64"
      ]
     },
     "execution_count": 294,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[data['survived']==1][\"sex\"].value_counts()#data[data['survived']==1]-->&data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 295,
   "id": "a807653d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='class', ylabel='count'>"
      ]
     },
     "execution_count": 295,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEECAYAAAAlEzNMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAeEElEQVR4nO3de3RU5aH+8e9cMgFyMYlEESGBAClKjFAo6OInkh4gHBWtLggwroCAdYUDWGKNQETukiASb+XmpVqCNUSgFlvbHghUPIKpTdUIGpCYolykQROSGWASJvv3h20qRcJE50LYz+evzMyeneddE+Zhv/tmMQzDQERETMsa6gAiIhJaKgIREZNTEYiImJyKQETE5FQEIiImZw91gNZqamrC69WBTiIirREWZjvva22uCLxeg9rak6GOISLSpsTHR533NU0NiYiYnIpARMTkVAQiIibX5vYRiIgEi9d7hpqaas6caQh1FJ/Z7Q5iY+Ox2Xz/elcRiIicR01NNe3adSAiohMWiyXUcS7IMAzc7jpqaqrp2PEqn9+nqSERkfM4c6aBiIjoNlECABaLhYiI6FZvwagIRERa0FZK4F++S14VgYiIyakIRERC4JNP9vHii8995/cfPPh3pk+/zy9ZLumdxZHR7WgfHhbqGK1yytOIq+50qGOISID16vUDevX6QahjAJd4EbQPD6N/zrpQx2iVsuUTcKEiELlYffbZQZYuXYjdbsdms3Hrrbfz9ts7WbgwD4Dbb09ny5Y/8eijCzhx4gR1dSdISEikX7/+/Pd/38aXXx4nJ2cm06fP5Le/3cTw4SPZufPP5ObOB2DSJCcFBb/gvff+xoYNL2O1WklN7cvUqTM4fvw4ixbNxTAM4uIu99uYNDUkItIK775byg9+0Jsnn1zFhAmTqa+vO++y/fsPYM2aX+J0TuAPf/gdAH/60xvceuuo5mVuvPH/sWdPOadOneLjj/dy9dVdsNls/PKXa3nqqdWsXv0Cx4//g3fffYeiovUMG5bOM8+sZci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8f3/K6Lla+jk9ExFctfR8G5Kih1157jbVr1wLQvn17LBYLKSkplJaWArBz504GDBhAamoqZWVleDwe6uvrqaysJDk5ORCRRETkPAKyRTBixAjmzJnD3XffzZkzZ8jNzaVHjx488sgjFBQUkJSURHp6OjabjczMTJxOJ4ZhkJ2dTXh4eCAiiYjIeViM73KsUQg1NnpbNTXUP2ddgBP5V9nyCVRX14c6hohcYoI+NSQiIm2HikBExORUBCIiJqciEBExORWBiIjJqQhERExORSAiYnIqAhERk1MRiIiYnIpARMTkVAQiIianIhARMTkVgYiIyakIRERMTkUgImJyKgIREZNTEYiImJyKQETE5FQEIiImpyIQETE5u79X2NjYSG5uLocPH6ahoYGpU6fSqVMnsrKy6NatGwDjx4/nlltuobi4mKKiIux2O1OnTiUtLc3fcURE5AL8XgRbtmwhJiaG5cuXU1NTw5133sm0adOYNGkSkydPbl6uurqawsJCNm3ahMfjwel0MnjwYBwOh78jiYhIC/xeBCNHjiQ9Pb35sc1mY8+ePVRVVVFSUkJiYiK5ubmUl5fTr18/HA4HDoeDhIQEKioqSE1N9XckERFpgd+LICIiAgCXy8X999/PzJkzaWhoYMyYMaSkpLB69WpWrlxJ7969iYqKOut9Lpfrguu32SzExHTwd+yLyqU+PhG5uPi9CACOHj3KtGnTcDqdjBo1irq6OqKjowEYPnw4ixcvZsCAAbjd7ub3uN3us4rhfLxeg9rakz7liI+/8PouRr6OT0TEVy19H/r9qKHjx48zefJkcnJyGD16NABTpkyhvLwcgN27d9OnTx9SU1MpKyvD4/FQX19PZWUlycnJ/o4jIiIX4PctgjVr1lBXV8eqVatYtWoVALNnz2bp0qWEhYXRsWNHFi9eTGRkJJmZmTidTgzDIDs7m/DwcH/HERGRC7AYhmGEOkRrNDZ6WzU11D9nXYAT+VfZ8glUV9eHOoaIXGKCOjUkIiJti4pARMTkVAQiIianIhARMTkVgYiIyakIRERMTkUgImJyKgIREZNTEYiImJyKQETE5FQEIiImpyIQETE5FYGIiMmpCERETE5FICJicj4Vwauvvn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ywfvx4LBYLS5cuJTY2lkceeYSCggKSkpJIT08PVhwREfmnoBWBw+FgxYoV5zy/fv36YEUQEZFvoYP2RURMTkUgImJyKgIREZNTEYiImJyKQETE5FQEIiImpyIQETE5FYGIiMmpCERETE5FICJicioCERGTUxGIiJicikBExORUBCIiJqciEBExORWBiIjJqQhERExORSAiYnIqAhERk1MRiIiYXNBuXn8+TU1NLFiwgH379uFwOFiyZAmJiYmhjiUiYhoh3yLYtm0bDQ0NbNiwgZ///Ofk5+eHOpKIiKmEvAjKysq46aabAOjbty979uwJcSIREXOxGIZhhDLAww8/zIgRI7j55psBGDp0KNu2bcNuD/mslYiIKYR8iyAyMhK32938uKmpSSUgIhJEIS+CH/7wh+zcuROA999/n+Tk5BAnEhExl5BPDf3rqKH9+/djGAZLly6lR48eoYwkImIqIS8CEREJrZBPDYmISGipCERETE5FICJicjpOMwjy8/PZu3cv1dXVnD59mq5du/LJJ59w44038sQTT5y17KOPPsqkSZPo3LnzedeXkZFBQUEBXbp0CXR0+adDhw5x++2306dPn+bnBg0aBMD06dMv+P7a2lreeustRo0aFbCMAs8++yy7du3CarVisVjIzs4mJSUl4L83OzubcePGNf9NtDUqgiCYPXs2AJs3b+bTTz/lwQcfpLS0lKKionOWffjhh4MdT3zUs2dPCgsLv9N79+3bx/bt21UEAXTgwAG2b9/OK6+8gsVi4eOPP2bWrFls2bIl1NEueiqCEDp48CD33nsvX331FWlpacyYMYPMzEwWLFjAG2+8wXvvvcfJkyd59NFH2bJlC2+99RadOnWipqYm1NEFmsv8iSeeIC0tjaSkJJKSkvjRj37Ec889h91u5+qrr+axxx5jzZo1VFRUsGHDBsaOHRvq6JekuLg4jhw5wsaNGxkyZAjXXHMNGzduZN++fSxZsgSAmJgYli5dSkREBEuWLKG8vJzGxkZmzJjBsGHDyM/Pp6ysDIDbbruNiRMnMnv2bBwOB4cPH+Yf//gH+fn59OnTh5dffplXX32V+Ph4vvzyy1AO/XtTEYSQx+Nh1apVeL1ehg4dyowZM856PS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C/fv3s2vXLurr63G5XERHR/Piiy/S1NTErbfeyrFjx9i2bRvDhw9nypQpbN++nbq6Onbt2kWfPn2YPXs2f/3rXzlx4oSKQC4qmhoSacGnn37afHGy5ORkoqOjAQgPD+err77igQceYN68eZw8eZLGxkaysrL46quvmDhxIn/84x+x2+2MHj2a2NhY7r33Xl5++WVsNlsIRyRyLhWBSAt69OjRfHGyzz//nIKCAgB27tzJ0aNHKSgo4IEHHuD06dMYhsHrr7/OnXfeSWFhIb169aK4uJiSkhL69+/Pr371K0aOHMnzzz8fyiGJnEPXGhJpgcfjITc3l2PHjuH1ehk2bBg1NTVMnDiRrKwsbDYbDoejeV+C3W5n4cKFdOjQgbCwMBYtWoRhGOTk5GCz2bBarcyZM+e8FzMTCQUVgYiIyWlqSETE5FQEIiImpyIQETE5FYGIiMmpCERETE5FICJicioCERGT+/9apPkPVK6idgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#各船舱级别死亡与存活人数统计\n",
    "sns.countplot(x='class', hue=\"survived\",data=data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 296,
   "id": "1a6092be",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.FacetGrid at 0x1dc1ac500d0>"
      ]
     },
     "execution_count": 296,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAFgCAYAAACFYaNMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAA4HklEQVR4nO3dd3hUVeI+8PdOSSaZlCEdCAlpdCkCCQgEUIqACCLdBV1cVhQXEXFBpKksRUVU1oLdL8WyCFhApCoiEJESIYSEEkoSCOk9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8QCJiIShAVMRCQIC5iISBAWMBGRICxgIiJBWMBERIK4xFJkotqUlZXh+eefR2lpKQoLCzFq1Ci0a9cOL7zwArRaLQIDA+Hp6YmlS5di9erV+O677yBJEgYPHoyJEyeKjk8ujgVMLu38+fMYMmQIBgwYgJycHEyYMAFarRYvv/wy4uLisGLFCuTk5OD06dPYsmUL1q1bB0mS8Mgjj6Bnz543rCgksjYWMLm0oKAgfPrpp9i2bRt8fHxgNBpx5coVxMXFAbi6F8KWLVuQnp6O7OzsmiWwxcXFuHDhAguYbIoFTC7to48+QseOHTF+/HgcOHAAP/30E8LCwnD69GnExsYiOTkZABAdHY3Y2Fh88MEHkCQJn3zyiUNs6kSujQVMLq1v375YuHAhvv32W+h0OiiVSsyfPx9z5syBt7c31Go1QkND0apVK3Tv3h3jxo2DXq9H+/btERoaKjo+uThuxkNuZ+3atRg0aBACAgKwYsUKqNVqPPnkk6JjkRviFTC5ncDAQEyaNAne3t7w9fWt2ZuXyN54BUxEJAgXYhARCcICJiIShAVMRCQIC5iISBAWMBGRIP8P1SDFK54TB5QAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#分析船员的年龄分布\n",
    "sns.displot(data['age'].dropna(),kde=True,color='darkred',bins=40)#分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 297,
   "id": "a806ac2d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 297,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAD3CAYAAADSftWOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAVJklEQVR4nO3df0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6/5syZI7/fr7y8PF24cCHrua67evWq3nvvPS1btkySO96Xf/rTn/SNb3xDP/vZz3T+/Hl9//vfVzgcTksuVw6buH36/ZIlSxQMBiVJfX19Ki0tzXiGS5cuacOGDXr22We1evVq1+SSpFdffVWdnZ2SpPz8fDmOo6VLl2Y92wsvvKDu7m51dXXpK1/5itrb21VRUZH1XAcOHNCuXbskSRcvXtTo6KgefPDBrOe677779MYbb8gYo4sXL2psbEz3339/1nNdd/z4cT3wwAPTl93w+vd6vdM/PH/hC1/Q5ORk2nK5coalG6ffDw4O6qc//aleeuklnT59Wk1NTQqHw/L7/WptbZXH48lontbWVv3973+X3++fvu75559Xa2trVnNJ0rVr17R161ZdunRJk5OT2rhxoxYtWpT1v9mNampqtH37duXk5GQ918TEhLZu3aqhoSE5jqMtW7bozjvvzHouSfr5z3+uYDAoY4x+8pOfqKioyBW5JOkPf/iDcnNz9YMf/ECSXPG+DIVC2rZtm95//32Fw2GtX79eS5cuTUsuV5Y3ACA6Vw6bAACio7wBwEKUNwBYiPIGAAtR3gBgIcobACxEeQOAhf4PGwClTLTVNFwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data['age'].hist(bins=30)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 298,
   "id": "f8ef53f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='sibsp', ylabel='count'>"
      ]
     },
     "execution_count": 298,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEECAYAAAAlEzNMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAXwElEQVR4nO3dbXBU9cH38d8+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qp19xbeM1AqAfeXl5uu666/Twww9r586dva4hdP311+uGG26QJKWnp+vo0aNasWKFzp49qyVLlvS6Auatt94qp9OpCRMmKD4+XmfPnrXl+wGuhBAA/aipqdHMmTP105/+VHPnztX27dt7Pvfhhx/qX//6lyTp7bff1rRp0/SrX/1K8+bNU2VlpaZNm6bq6mpJUlNTk6RPLrAXDAb1hS98YeS/GaAPHJsC/bj55pu1du1abdmyRU6nU36/X4cPH5YkJSQkaOPGjTp16pTS09M1e/ZsHTp0SEVFRYqJidGYMWP07W9/W2+++aZOnz6tJUuWKBAIqLS0dFRdnRTXPl4sBiJs9+7d+sc//qE1a9bYPQW4Ik4NAYDhOCIAAMNxRAAAhiMEAGA4QgAAhiMEAGA4QgAAhvv/LcDpCDK0HsYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#带有家庭成员的人数统计\n",
    "sns.countplot(x='sibsp',data=data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 299,
   "id": "5f2f6c9b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='alone', ylabel='count'>"
      ]
     },
     "execution_count": 299,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEECAYAAAAlEzNMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAUP0lEQVR4nO3df0zU9x3H8dfd4Z3KHVIjmi56RLRks45AS6Adkc7FlXaN+2H0KmeuNbZLa2Y2aGsBHeBsU2BWtrWJ69Z2WXuuYayydWu2bJO5kmDLWpK1HRt1Yx2d1TFWpd6d9RD47o+lTFfFc9yXo3yej7+87/f43vuSr/fk++Xuew7L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scEQATWL16tXbt2qWf/exnyszMlMvlGr+M91133aUdO3bol7/8pc6cOaPdu3crLe3C/6U+9alPcRE/TFtcdA4ADMepIQAwHCEAAMMRAgAwHCEAAMMRAgAwHCEAAMMRAgAw3L8BOKeevtNaq/IAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.countplot(x='alone',data=data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 300,
   "id": "15526fa8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 300,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlQAAAEuCAYAAABIyYwTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAVsElEQVR4nO3dXYhd9b3H4e+ePZ28TCaMYrySiFHDUWQwJSRCMDYgjhdarajolHihiEkLNhEliZrEYjAGS5AKtlrszajEYER6U6wNloDWXISqNJhKgxWqYqNWnD3Rmbysc3Fsajg6E/Ofl5Xkea46e2fW+q/964yfWWu/NKqqqgIAwHFrm+wFAACc6AQVAEAhQQUAUEhQAQAUElQAAIUEFQBAofbJ3Pnhw4dz6ND4vmtDs9kY931wbMyiPsyiPsyiPsyiXuo4j+99r/mt901qUB06VOWzz/aP6z66u6eP+z44NmZRH2ZRH2ZRH2ZRL3Wcx6xZXd96n0t+AACFBBUAQCFBBQBQSFABABQSVAAAhQQVAEChY3rbhGuvvTZdXf/3UsGzzjory5Yty+rVq9NoNHL++edn/fr1aWtry9atW7Nly5a0t7dn+fLlWbJkybguHgCgDkYNqqGhoSRJf3//kduWLVuWFStWZOHChVm3bl22b9+eiy++OP39/dm2bV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btmxJe3t7li9fniVLlkz2sk8qBw4cyL333pv3338/w8PDWb58ec477zyzmASHDh3K/fffn3fffTfNZjMbN25MVVVmMYk++eSTXHfddfntb3+b9vZ2s5hE1157bbq6/u+tDs4666wsW7bsxJ1HdZJ66aWXqlWrVlVVVVV/+ctfqmXLlk3yik4NTz75ZHXVVVdVN9xwQ1VVVXXHHXdUr7/+elVVVbV27drqD3/4Q/Wvf/2ruuqqq6qhoaHq888/P/K/GTvPP/98tWHDhqqqqurTTz+tLrvsMrOYJC+//HK1evXqqqqq6vXXX6+WLVtmFpNoeHi4+slPflJdccUV1d///nezmERffvlldc011xx124k8j5P2kp+PwZkcs2fPzmOPPXbk6927d2fBggVJksWLF+e1117LW2+9lXnz5qWjoyNdXV2ZPXt29uzZM1lLPildeeWV+dnPfnbk62azaRaT5PLLL8+DDz6YJPnggw9yxhlnmMUk2rRpU2666aaceeaZSfyOmkx79uzJF198kVtvvTW33HJL3njjjRN6HidtUH3bx+Awvnp7e496d/yqqtL46vMEOjs7MzAwkFardeQU739ub7VaE77Wk1lnZ2dmzJiRVquVO++8MytWrDCLSdTe3p5Vq1blwQcfTG9vr1lMkhdeeCGnn376kT+2E7+jJtPUqVNz22235amnnsrPf/7z3H333Sf0PE7aoPquH4PD+Ghr++//xQYHBzNz5sz/N5vBwcGjflgYGx9++GFuueWWXHPNNbn66qvNYpJt2rQpL730UtauXZuhoaEjt5vFxNm2bVtee+21LF26NG+//XZWrVqVTz/99Mj9ZjGxzjnnnPzwhz9Mo9HIOeeck+7u7nzyySdH7j/R5nHSBpWPwamHCy+8MDt37kyS7NixI/Pnz09PT0927dqVoaGhDAwMZO/eveYzxj7++OPceuutueeee3L99dcnMYvJ8uKLL+aJJ55IkkybNi2NRiMXXXSRWUyCZ555Jk8//XT6+/tzwQUXZNOmTVm8eLFZTJLnn38+Dz/8cJLko48+SqvVyqJFi07YeZy075TuY3Amzz//+c/cdddd2bp1a959992sXbs2Bw4cyJw5c7Jhw4Y0m81s3bo1zz33XKqqyh133JHe3t7JXvZJZcOGDfn973+fOXPmHLntvvvuy4YNG8xigu3fvz9r1qzJxx9/nIMHD+b222/Pueee6+diki1dujQPPPBA2trazGKSDA8PZ82aNfnggw/SaDRy991357TTTjth53HSBhUAwEQ5aS/5AQBMFEEFAFBIUAEAFBJUAACFBBUAQCFBBQBQSFABABQSVAAAhf4XDeQNvAbuQ44AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data['fare'].hist(color='blue',bins=30,figsize=(10,5))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5904f2d6",
   "metadata": {},
   "source": [
    "### Step3：缺失值检测"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6552237e",
   "metadata": {},
   "source": [
    "#### （1）缺失数据检测"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 301,
   "id": "d28c8433",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>adult_male</th>\n",
       "      <th>deck</th>\n",
       "      <th>embark_town</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 15 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass    sex    age  sibsp  parch   fare  embarked  class  \\\n",
       "0       False   False  False  False  False  False  False     False  False   \n",
       "1       False   False  False  False  False  False  False     False  False   \n",
       "2       False   False  False  False  False  False  False     False  False   \n",
       "3       False   False  False  False  False  False  False     False  False   \n",
       "4       False   False  False  False  False  False  False     False  False   \n",
       "..        ...     ...    ...    ...    ...    ...    ...       ...    ...   \n",
       "886     False   False  False  False  False  False  False     False  False   \n",
       "887     False   False  False  False  False  False  False     False  False   \n",
       "888     False   False  False   True  False  False  False     False  False   \n",
       "889     False   False  False  False  False  False  False     False  False   \n",
       "890     False   False  False  False  False  False  False     False  False   \n",
       "\n",
       "       who  adult_male   deck  embark_town  alive  alone  \n",
       "0    False       False   True        False  False  False  \n",
       "1    False       False  False        False  False  False  \n",
       "2    False       False   True        False  False  False  \n",
       "3    False       False  False        False  False  False  \n",
       "4    False       False   True        False  False  False  \n",
       "..     ...         ...    ...          ...    ...    ...  \n",
       "886  False       False   True        False  False  False  \n",
       "887  False       False  False        False  False  False  \n",
       "888  False       False   True        False  False  False  \n",
       "889  False       False  False        False  False  False  \n",
       "890  False       False   True        False  False  False  \n",
       "\n",
       "[891 rows x 15 columns]"
      ]
     },
     "execution_count": 301,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.isnull() #或者isna()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 302,
   "id": "4e0dc83a",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 302,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWIAAAEvCAYAAAB/msvIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAABDO0lEQVR4nO3deVyU5fr48c+wioAiouaCuGvlMTWX+paZFlmaJwUVFNGUFpfsJHgMFxQVccvl5IK5ZaIF6lETLfO4pXnM3HDpuBQuKblAoqyyzfP7wx+TmMLMwww8A9f79ZrXy5l55n7uYeTinuu5r/vWKYqiIIQQoszYlHUHhBCiopNALIQQZUwCsRBClDEJxEIIUcYkEAshRBmTQCyEEGXMzpyN6fV6wsPDOX/+PA4ODkRERODl5WXOUwghRLlj1hHxrl27yMnJITY2lpCQEGbOnGnO5oUQQlNOnjxJYGDgXx7fs2cPvr6++Pn5sX79+mLbMeuI+Nix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JLLzF58uQyn8Uh7pMcsdCE+vXrM3fuXO7cucOyZcvKxRxigAkTJhASEsLNmzfx8PAo88Wrpk+fzuzZsw3LjYaHh8s8fQ2QEbHQhClTplCnTh2effZZnJycHrvbsLW5cOECqamp2NnZcefOHUaNGlWm/Slvy42WFzIiFppgZ2dH//79y7obZrdhwwaio6OJiori9ddf54svviiTfhRU+NnZ2REeHm5YblQu1mmDjIiFsKBq1apRs2ZNMjIy6NixI3fv3i2TfiQlJZGUlESbNm3w8PAoN8uNlhcyIhbCglxdXdm1a5ehZPv27dtl0o/yutxoeaH5HTqEsGbp6en89ttveHh4sGrVKrp06ULHjh3LrD9BQUHlarnR8kICsRAVyMCBA8vlcqPWTlITQlQg5XW5UWsngViICqQiLDdqjSQQC1GBlNflRq2dTF8TogIpWG40JyfHcBNlTy7WCVGB9OzZk8zMzHKz3Gh5ISNiISqQ8rbcaHkhgViICuRf//oXa9eupWbNmgwfPrxMd5QWf5JALEQFUl6XG7V2EoiFqEDK63Kj1k4u1glRgeTl5bFhwwYuXLhAo0aN8PPzKxebtFo7CcRCCFHGJDUhhBBlTAKxEEKUMQnEQghRxiQQCyFEGZNALIQQZez/Aap8WkH+ufxWAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#用图像的方式更加直观的显示\n",
    "sns.heatmap(data.isnull())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "32249e12",
   "metadata": {},
   "source": [
    "#### （2）寻找缺失数据\n",
    "\n",
    "有四列数据含有缺失值，分别是age、embarked、deck和embark_town"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 303,
   "id": "93d251a1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 303,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA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Mn3/NMzl/CXucCOBp7Ha4NVM06kpKS4OHhAbPZjKioKKlPvMk2depUlJeXIzs7G5WVlfDy8rK9y0svb29vrFq1ynbegJeXl5S69pSamorU1FTb17JOGXvggQd09/drGzVqFPr27Yt169YhKioKQNUagHWxsqysrF4ulNtl/72e03J2794txo8fLyIiIsTu3btFSUmJnnI1HDlyRAwYMEAMHjxYDB48WMq7lBxRRkaG2LJliygtLRX79u0TmZmZ0mrXPhmt9tf1TXh4uBBCiFdeeUWUlJSIsLAwabVv374t3nvvPREbGys2btwo7cQuI7z99ttGD+EXk/UORNmmT58uPv/8czF79myxfft2MWzYMN01dc10v/32W8TGxkp9ysaqrKwMFovFtm1F5mOqjqRTp07o1KkTANjeDyZL9VcB/fDDD1JeBWRP1veLlZSU4P7775f2AAMAuLm51et94L+ErLtNlYTEp95kqv3UX1xcnO6aukLXegqRPaxZswa7d++uceur911KVNPgwYNt/2196qY+GzJkCFavXo2HH34YISEhdjkusSGorwF2L/V1UmXtFwPAnDlzpNTUFbru7u7YuHFjjS08soLRnm/BpSqyVv5Vqd5nHDBggPSTrxqK+hpgVEVX6LZq1epnzXxZoetot75kfykpKZg3bx7MZjO8vb2xYMECdO/e3ehhkQSOODuvK12hK/OE9toc7daX7G/RokVYvnw5unbtih9//BFxcXFSn5ZqKBwpwG7dugV3d3dpR6E6BD2rcP369bP96t27t5SVPaK7sb6/7G5fO5v58+fX+Prll18WQghx7do1I4ajyYIFC2z/ffToUTF06FADR2MMXTPd6hubr169itWrV+v+IUBU286dOwFU7V6Ii4tDQEAAkpOTnbbPv3XrVqxduxZ5eXm2p6OEELbZovXNtfWRPc9EdhS6HgOuLTQ01PYNQiTLvX6YT506VeFI6peEhATbgwaOZNmyZUhLS5Py+i1HpCt0q5+AlZ2djRYtWkg7Uo2otsrKSpw/f77G8Z/OdhASgHtObGS+G0wmFWciOwpd7YXqJ2B98sknDvlTlxzHn/70J5SVldU4tNsZW1oy3wGmijVY7X0msiPQNdO15wlYRLXJOPC6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PBOZoUtECvFMZC6kEZFCPBOZoUtEpBTbC0RECjF0iYgUYugSESnE0CUiUoihS0Sk0P8B1+YR8jGPrdUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#图像显示彩色\n",
    "sns.heatmap(data.isnull(),yticklabels=False,cbar=False,cmap='rainbow')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c81b99e5",
   "metadata": {},
   "source": [
    "#### （3）统计各缺失数量，选取合适的解决办法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 304,
   "id": "3bc9cf9f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "177"
      ]
     },
     "execution_count": 304,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#age数据缺失的个数\n",
    "data['age'].isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 305,
   "id": "4587fb7f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.19865319865319866"
      ]
     },
     "execution_count": 305,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#age数据缺失率\n",
    "data['age'].isnull().sum()/(data['age'].count()+data['age'].isnull().sum())#data['age'].count()表示age存在的个数，分母=891"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 306,
   "id": "6a03ae47",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 306,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#embarked数据缺失的个数\n",
    "data['embarked'].isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 307,
   "id": "a0e068f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.002244668911335578"
      ]
     },
     "execution_count": 307,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#embarked数据缺失率\n",
    "data['embarked'].isnull().sum()/891"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 308,
   "id": "1c1d3231",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "688"
      ]
     },
     "execution_count": 308,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#deck数据缺失的个数\n",
    "data['deck'].isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 309,
   "id": "005a0b33",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7721661054994389"
      ]
     },
     "execution_count": 309,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#deck数据缺失率\n",
    "data['deck'].isnull().sum()/891"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 310,
   "id": "91a3a2a8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 310,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#embark_town数据缺失个数\n",
    "data['embark_town'].isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 311,
   "id": "c5d2d9db",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.002244668911335578"
      ]
     },
     "execution_count": 311,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#embark_town数据缺失个数\n",
    "data['embark_town'].isnull().sum()/891"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ab57e49c",
   "metadata": {},
   "source": [
    "### step4:数据清洗"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0d35244c",
   "metadata": {},
   "source": [
    "#### （1）处理年龄缺失值"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "da983a61",
   "metadata": {},
   "source": [
    "根据船员中age与class之间的关系，将年龄分为三个不同的级别，然后求出各个不同级别年龄的平均值，用该值替代表中的缺失部分。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 312,
   "id": "9808c783",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='pclass', ylabel='age'>"
      ]
     },
     "execution_count": 312,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAssAAAGnCAYAAABB1hpnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAjoElEQVR4nO3df5ScZWEv8O/sjjHkF7uBWGsVSRQtUc/ttWlotVkSIETLRdFDDIET9AS1WHt0ewATuMnGEirkqFFELeit9Z6kQptKPfaHlrAkLoU2x/YWxJXq0SQEULSQXUg2GPbH3D9ySS/iCyHZ2Td59/P5J3l3Zuf5zs68u9999nlmao1GoxEAAOBZWsoOAAAARytlGQAACijLAABQQFkGAIACyjIAABSolx2gyMjISIaHvVAHAADN9aIXtRZedtSW5eHhRvr795UdAwCAipsxY2rhZZZhAABAAWUZAAAKKMsAAFBAWQYAgALKMgAAFFCWAQCggLIMAAAFlGUAACigLAMAQAFlGQAACijLAABQQFkGAIACyjIAABSoN+NGBwcHs3Llyjz88MNpaWnJ2rVrU6/Xs3LlytRqtZxyyilZs2ZNWlp0dQAAjl5NKcvf+ta3MjQ0lFtuuSV33XVXPv3pT2dwcDCdnZ057bTT0tXVle7u7ixcuLAZwwMAwKhoSlmeOXNmhoeHMzIykr1796Zer+eee+7J3LlzkyQdHR256667lOVDsHVrd+64Y3PZMV6Q/v6+JElbW3vJSV6YM85YmPnzzyw7BgBwFGlKWZ40aVIefvjhvPWtb01fX19uvPHGfPvb306tVkuSTJ48OXv27HnO22htraWtbVIz4h1TJk2akHr92Fqu8nRZPvHEE0pO8sJMmjTBcw4AeIamlOUvf/nL+d3f/d1cdtll+clPfpJ3v/vdGRwcPHj5wMBApk2b9py3MTzcSH//vmbEO6bMnTsvc+fOKzvGC9LV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UZQAAKKAsAwBAAWUZAAAKKMsAAFBAWQYAgALKMgAAFFCWAQCggLIMAAAFlGUAACigLAMAQAFlGQAACijLAABQQFkGAIACyjIAABRQlgEAoICyDAAABZRlAAAooCwDAEABZRkAAAooywAAUEBZBgCAAsoyAAAUUJYBAKCAsgwAAAWUZQAAKKAsAwBAAWUZAAAKKMsAAFBAWQYAgAKHXJZ37tyZb33rW3nkkUfSaDSamQkAAI4K9UO50saNG7N58+Y8/vjjOe+887Jr1650dXU1OxsAAJTqkGaW//7v/z5f/vKXM3Xq1LznPe/Jvffe2+xcAABQukMqy08vu6jVakmSCRMmNC8RAAAcJQ6pLJ9zzjm56KKLsmvXrrzvfe/LWWed9byf89hjj+X000/Pj370ozzwwANZunRpLrzwwqxZsyYjIyNHHBwAAJrtkNYsL1u2LG9605vygx/8ILNmzcprX/va57z+4OBgurq6MnHixCTJtddem87Ozpx22mnp6upKd3d3Fi5ceOTpAQCgiQ6pLF955ZUH/9/T05MXvehFeelLX5qLLrooxx9//LOuv27dulxwwQX5whe+kCTp7e3N3LlzkyQdHR256667nrcst7bW0tY26ZDvyKGq171aHtVQr7c05Rzh2PX09zfPCxhbzr1qO6SyvH///rziFa/InDlzcu+99+a+++7L9OnTs2LFitx4443PuO6tt96a6dOnZ968eQfLcqPROLjeefLkydmzZ8/zjjk83Eh//74Xen+e19CQJSBUw9DQSFPOEY5dT39/87yAseXcO/bNmDG18LJDKsu7d+/O+vXrkyTz5s3L8uXL09nZmYsuuuhZ1/3qV7+aWq2Wf/7nf87999+fFStWZPfu3QcvHxgYyLRp017ofQAAgDF3SGsS9u7dmx/96EdJkh/96EcZGBhIX19f9u179m9Qf/EXf5GNGzdmw4YNOfXUU7Nu3bp0dHRk27ZtSQ4s45gzZ84o3gUAAGiOQ5pZ7urqyhVXXJGf/exn+dVf/dWsXr06//AP/5BLL730kAZZsWJFVq9enfXr12fWrFlZtGjREYUGAICxcEhlube3NwMDA5kwYUIee+yxXH755bntttue9/M2bNhw8P8bN248/JQAAFCCQ1qGsWnTpmzYsCGnn356rr322rz61a9udi4AACjdIZXl9vb2vOQlL8nAwEBOO+20PP74483OBQAApTuksjx16tTcfvvtqdVqueWWW57x6hYAAFBVh1SWr7nmmrzsZS/LZZddlp07d+ajH/1ok2MBAED5DmmD35QpUzJ79uwkycqVK5saCAAAjhbe+xkAAAoc0sxylfT396Vl32OZ+L2/KzsKHLaWfY+lv3/cnb4AMObMLAMAQIFxNzXV1taeXU8M5eez/0fZUeCwTfze36Wtrb3sGABQeWaWAQCggLIMAAAFxt0yDKAcX/rSF7Jz5/ayY1Tajh0Hvr5dXV7is9lOPnlWli9/f9kxgDGgLANjYufO7dnx/Xtz0pThsqNU1vGpJUmGH/4/JSeptl17W8uOAIwhZRkYMydNGc6qOXvLjgFH5Jp/nVJ2BGAMWbMMAAAFlGUAACigLAMAQAFlGQAACijLAABQQFkGAIACyjIAABRQlgEAoICyDAAABZRlAAAooCwDAEABZRkAAAooywAAUEBZBgCAAvWyAwAAzfOlL30hO3duLztGpe3YceDr29W1suQk1XfyybOyfPn7x3RMZRkAKmznzu357g++k7SVnaTCWg/8892ffafcHFXXX86wyjIAVF1bMjJ/pOwUcERatpazetiaZQAAKKAsAwBAAWUZAAAKKMsAAFCgKRv8hoeHs2rVquzYsSOtra259tpr02g0snLlytRqtZxyyilZs2ZNWlp0dQAAjl5NKctbtmxJktxyyy3Ztm3bwbLc2dmZ0047LV1dXenu7s7ChQubMTwAAIyKpkztnnXWWVm7dm2S5Mc//nFOPPHE9Pb2Zu7cuUmSjo6O3H333c0YGgAARk3TXme5Xq9nxYoV2bx5cz7zmc9ky5YtqdVqSZLJkydnz549z/n5ra21tLVNakIuSz+ohnq9pSnnSLPU6y0ZLjsEjJJj6fzzc48qKePca+qbkqxbty6XX3553vWud2X//v0HPz4wMJBp06Y95+cODzfS379v1DMNDXlRdqphaGikKedIszj3qJJj6fxz7lElzTr3ZsyYWnhZU37d/NrXvpabbropSXLcccelVqvl9a9/fbZt25Yk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pYBKmLixInZt28ge/bsKTsKQGWYWQYoMH/+mcfUjOfFFy9Jkjz22KP51Kc+V3IagGowswxQAffe++8ZGNibJBkY2JvvfOeecgMBVISyDFABn/zkdc84/sQnri0pCUC1KMsAFfD0rHLRMQCHR1kGqIDJk6c85zEAh0dZBqiAyy575svFXX75lSUlAagWZRmgAqZNO/4XjqeVlASgWpRlgAq4/vqPP+P405/+RElJAKpFWQaogAcf3PULxw+UlASgWpRlgAp4xStO+oXjV5aUBKBalGWACjj//KXPOH7Xu5YWXBOAF8LbXR/ltm7tzh13bC47xguyY8f2JElX18rnuebR5YwzFh5Tb20M/78NG770jOP//b//LG9607yS0gBUh7LMqGtvby87Aow7jz76n895DMDhUZaPcvPnn2m2EwCgJGNWlkdGRvLRj3403//+9zNhwoRcc801eeUrbUABGA0TJx6Xn//8yYPHxx13XIlp4Mgca0sQLT+stjHb4Hf77bfnqaeeyl/+5V/msssuy3XXXTdWQwNU3kc+8j9/4XhVSUlg/Glvb7cEscLGbGb53/7t3zJv3oHNJr/xG7+R7373u895/dbWWtraJo1FNIBj3umnvzmTJk3Kvn37MmnSpHR0vKnsSHDYzjvv3Jx33rllx4AkY1iW9+7dmylTphw8bm1tzdDQUOr1Xx5heLiR/v59YxUP4Jh3+eVX5ZprunLFFf/T90+AF2DGjKmFl41ZWZ4yZUoGBgYOHo+MjBQWZQBeuP/23/57Nm3627JjAFTKmK1ZfuMb35ienp4kyT333JPXvOY1YzU0AAAcljGb2l24cGHuuuuuXHDBBWk0GvnYxz42VkMDAMBhqTUajUbZIX6ZwcFha+4AAGi651qzPGbLMAAA4FijLAMAQAFlGQAACijLAABQQFkGAIACyjIAABRQlgEAoICyDAAABZRlAAAooCwDAECBo/btrgEAoGxmlgEAoICyDAAABZRlAAAooCwDAEABZRkAAAooywAAUEBZBgCAAsoyo+7ee+/NsmXLyo4B48rg4GCuuOKKXHjhhTn//PPT3d1ddiQYF4aHh3PllVfmggsuyEUXXZRdu3aVHYlRVi87ANXyxS9+MV//+tdz3HHHlR0FxpWvf/3raWtry8c//vH09fXlHe94R84888yyY0HlbdmyJUlyyy23ZNu2bbn22mvzp3/6pyWnYjSZWWZUnXTSSbnhhhvKjgHjzlve8pZ8+MMfPnjc2tpaYhoYP84666ysXbs2SfLjH/84J554YsmJGG1mlhlVixYtykMPPVR2DBh3Jk+enCTZu3dvPvShD6Wzs7PcQDCO1Ov1rFixIps3b85nPvOZsuMwyswsA1TET37yk1x88cV5+9vfnnPPPbfsODCurFu3Lv/4j/+Y1atXZ9++fWXHYRQpywAV8Oijj2b58uW54oorcv7555cdB8aNr33ta7npppuSJMcdd1xqtZplUBWjLANUwI033pgnnngin//857Ns2bIsW7YsP//5z8uOBZV39tln53vf+14uuuiiXHLJJbnqqqvy4he/uOxYjKJao9FolB0CAACORmaWAQCggLIMAAAFlGUAACigLAMAQAFlGQAACijLAMe4M844I/v37y87BkAlKcsAAFCgXnYAAH65W2+9Nd3d3dm7d2/6+vrywQ9+MBMmTMhnP/vZJMns2bPzx3/8xwev/4Mf/CDXXXddRkZG8sQTT2TVqlV54xvfmJUrV2bXrl3Zv39/Lrnkkvze7/1ePvWpT+Vf/uVfMjIyknPOOSfvec97SrqXAEc3ZRngKLZv3778+Z//eXbv3p13vOMdqdVq+Zu/+ZuccMIJ+exnP5tHHnnk4HV/+MMfZsWKFXnta1+bv/3bv82tt96a17zmNdm2bVu++tWvJknuuuuuJAfeonfjxo35lV/5ldx6662l3DeAY4GyDHAU+63f+q20tLTkxBNPzOTJk/PUU0/lhBNOSJL84R/+4TOu+5KXvCSf//znM3HixAwMDGTKlCmZMmVKVq9endWrV2fv3r1529veliRZv3591q9fn0cffTTz5s0b8/sFcKxQlgGOYr29vUmSRx99NIODg0mS/v7+tLW15ZprrjlYfpPkT/7kT/KJT3wir3rVq/KZz3wmDz/8cH72s5+lt7c3n/vc57J///6cfvrpOffcc/PNb34z69evT6PRyDnnnJNzzjknv/Zrv1bKfQQ4minLAEexRx99NO9+97uzZ8+erFmzJo1GI7//+7+flpaWzJ49O294wxsOXvdtb3tb/uAP/iAnnHBCXvrSl6avry8zZszIf/7nf+a8887LpEmTsnz58kyYMCHHH3983v72t+f444/Pm9/85rzsZS8r8V4CHL1qjUajUXYIAJ7t1ltvzfbt23P55ZeXHQVg3PLScQAAUMDMMgAAFDCzDAAABZRlAAAooCwDAEABZRkAAAooywAAUOD/Atz6loopKTG8AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 864x504 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(12, 7))\n",
    "sns.boxplot(x='pclass',y='age',data=data)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "94ebb595",
   "metadata": {},
   "source": [
    "箱型图，也被称为箱线图，是一种描述数据离散分布情况的图形，可以直观地识别异常值和偏态。这种图表可以比较不同组别间的集中趋势、方差和偏度，并能够探索数据特征和异常值。\n",
    "\n",
    "在阅读箱型图时，主要需要关注以下几个部分：\n",
    "\n",
    "1. 箱体：箱体的上下边界分别是第三四分位数(Q3)和第一四分位数(Q1)，箱体的高度代表了中间50%的数据范围。\n",
    "2. 须子：须子的顶端是上四分位数(Q4)，底端是下四分位数(Q2)。\n",
    "3. 中线：中线位于箱体的中心，表示数据的中位数。如果数据是正态分布的，那么中线应该穿过箱体的中心。\n",
    "4. 异常值：任何超出箱体范围的点都被视为异常值，通常用一个点来表示。\n",
    "\n",
    "此外，箱型图还可以进行分组比较和假设检验，并且能够显示离群点的信息和数据的分组、峰度等。但需要注意的是，虽然箱型图具有诸多优点，但它也存在一定的局限性。\n",
    "\n",
    "https://zhuanlan.zhihu.com/p/426798602"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 313,
   "id": "cee92627",
   "metadata": {},
   "outputs": [],
   "source": [
    "#年龄按船舱中位数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 314,
   "id": "4a4af7af",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "37.0"
      ]
     },
     "execution_count": 314,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[data['pclass']==1]['age'].median()#Return the median of the values（中位数） over the requested axis."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 315,
   "id": "078f82d4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "29.0"
      ]
     },
     "execution_count": 315,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[data['pclass']==2]['age'].median()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 316,
   "id": "2ebe082b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "24.0"
      ]
     },
     "execution_count": 316,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[data['pclass']==3]['age'].median()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 317,
   "id": "0cb4baa8",
   "metadata": {},
   "outputs": [],
   "source": [
    "def addage(x):#x是一个列表，可以用下标取值\n",
    "    \n",
    "    Age = x[0]#年龄\n",
    "    Pclass = x[1]#船舱等级\n",
    "    \n",
    "    if pd.isnull(Age):#如果年龄为空，根据船舱等级中位数进行填补\n",
    "\n",
    "        if Pclass == 1:\n",
    "            return 37\n",
    "\n",
    "        elif Pclass == 2:\n",
    "            return 29\n",
    "\n",
    "        else:\n",
    "            return 24\n",
    "\n",
    "    else:#年龄不为空，还是原来值\n",
    "        return Age"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 318,
   "id": "4afcf07d",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>pclass</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>22.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>26.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>35.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>27.0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>19.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>26.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>32.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      age  pclass\n",
       "0    22.0       3\n",
       "1    38.0       1\n",
       "2    26.0       3\n",
       "3    35.0       1\n",
       "4    35.0       3\n",
       "..    ...     ...\n",
       "886  27.0       2\n",
       "887  19.0       1\n",
       "888   NaN       3\n",
       "889  26.0       1\n",
       "890  32.0       3\n",
       "\n",
       "[891 rows x 2 columns]"
      ]
     },
     "execution_count": 318,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[['age','pclass']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 319,
   "id": "c78f4a0e",
   "metadata": {},
   "outputs": [],
   "source": [
    "#对data数据age列赋值（通过addage函数将缺失值按照不同级别的船舱的年龄中位数进行填补）\n",
    "data['age'] = data[['age','pclass']].apply(addage,axis=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "880f4b84",
   "metadata": {},
   "source": [
    "这段代码定义了一个名为`addage`的函数，该函数接受一个包含年龄和舱位等级的列表作为输入。如果年龄为空（即缺失值），则根据舱位等级返回一个默认的年龄值。如果年龄不为空，则直接返回年龄值。最后，使用`apply`函数将`addage`函数应用于数据框`data`的'age'和'pclass'列，并将结果存储在新的'age'列中。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 320,
   "id": "cb560529",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 320,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWIAAAEvCAYAAAB/msvIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAABCaUlEQVR4nO3deVzU1f748dewioAiouaCuFvpNTWX+paaFi2aNwUVENGUFtdugtdwwRVxy+XmmlsmaqBeM9Eyc0szMzfcrkshWpILKIosMsB8fn/4Y5JSmPkwwIfh/ewxj4cz85nzOcPEmzPn836fo1MURUEIIUSpsSntDgghRHkngVgIIUqZBGIhhChlEoiFEKKUSSAWQohSJoFYCCFKmZ0lGzMYDEyaNIkLFy7g4OBAREQEXl5eljyFEEJYHYuOiHft2oVeryc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UoXr16qSnp9O+fXvu3r1bKv1ISkoiKSmJVq1a4eHhYTXLjVoLGRELUYxcXV3ZtWuXsWT79u3bpdIPa11u1FpofocOIcqytLQ0fvvtNzw8PFi1ahWdO3emffv2pdaf4OBgq1pu1FpIIBaiHOnXr59VLjda1snUhBDliLUuN1rWSSAWohwpD8uNlkUSiIUoR6x1udGyTtLXhChH8pYb1ev1xpsofXKxTohypHv37mRkZFjNcqPWQkbEQpQj1rbcqLWQQCxEOfKf//yHtWvXUr16dYYMGVKqO0qLP0kgFqIcsdblRss6CcRClCPWutxoWScX64QoR3Jycti4cSMXL16kQYMG+Pn5WcUmrWWdBGIhhChlMjUhhBClTAKxEEKUMgnEQghRyiQQCyFEKZNALIQQpez/ASTy4iBHMg5uAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#用图像的方式更加直观的显示\n",
    "sns.heatmap(data.isnull())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c5931334",
   "metadata": {},
   "source": [
    "由此可见，年龄的缺失值已经填充好了。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "af288a4a",
   "metadata": {},
   "source": [
    "#### （2）处理deck缺失值\n",
    "\n",
    "因为deck表示港口号，而港口号和我们想要预测的存活/死亡的结果影响不大，又因为大部分港口号缺失严重的原因，此列可以直接删掉。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 321,
   "id": "3d7e6775",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7721661054994389"
      ]
     },
     "execution_count": 321,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['deck'].isnull().sum()/891"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 322,
   "id": "aedc95ce",
   "metadata": {},
   "outputs": [],
   "source": [
    "data.drop('deck',axis=1,inplace=True)#inplace if False, return a copy. Otherwise, do operation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 323,
   "id": "48cecd90",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>adult_male</th>\n",
       "      <th>embark_town</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>Second</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>24.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>23.4500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>32.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>Q</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>Queenstown</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass     sex   age  sibsp  parch     fare embarked   class  \\\n",
       "0           0       3    male  22.0      1      0   7.2500        S   Third   \n",
       "1           1       1  female  38.0      1      0  71.2833        C   First   \n",
       "2           1       3  female  26.0      0      0   7.9250        S   Third   \n",
       "3           1       1  female  35.0      1      0  53.1000        S   First   \n",
       "4           0       3    male  35.0      0      0   8.0500        S   Third   \n",
       "..        ...     ...     ...   ...    ...    ...      ...      ...     ...   \n",
       "886         0       2    male  27.0      0      0  13.0000        S  Second   \n",
       "887         1       1  female  19.0      0      0  30.0000        S   First   \n",
       "888         0       3  female  24.0      1      2  23.4500        S   Third   \n",
       "889         1       1    male  26.0      0      0  30.0000        C   First   \n",
       "890         0       3    male  32.0      0      0   7.7500        Q   Third   \n",
       "\n",
       "       who  adult_male  embark_town alive  alone  \n",
       "0      man        True  Southampton    no  False  \n",
       "1    woman       False    Cherbourg   yes  False  \n",
       "2    woman       False  Southampton   yes   True  \n",
       "3    woman       False  Southampton   yes  False  \n",
       "4      man        True  Southampton    no   True  \n",
       "..     ...         ...          ...   ...    ...  \n",
       "886    man        True  Southampton    no   True  \n",
       "887  woman       False  Southampton   yes   True  \n",
       "888  woman       False  Southampton    no  False  \n",
       "889    man        True    Cherbourg   yes   True  \n",
       "890    man        True   Queenstown    no   True  \n",
       "\n",
       "[891 rows x 14 columns]"
      ]
     },
     "execution_count": 323,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 324,
   "id": "da3473f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 324,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAAErCAYAAAB981BrAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAcqElEQVR4nO3deXRV1aHH8d8liZEyhCFMEVQmEalUK5G6wFJUlJbRRBJsAoJpSwCtBdSCmjCJgBi0SpmqUQQBiQssSC2IoghOSAVSSwyNYBQNSQwhZCDTPe8P3r0vCeBruftsDH4/a2UtQ9b65Xhz88s5e++zj8dxHEcAACsanO8DAIAfEkoXACyidAHAIkoXACyidAHAIkoXACwK/q4vzvTYOgwAuHBM/46FuJzpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC4AWETpAoBFlC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950003yeDy1ztQdx5HH49Gbb755zrk1FRcXa+nSpcrMzFTnzp01btw4NWvWzEi25P578/Dhw9q1a5dGjBihbdu26eqrr1aHDh2M5R85ckTz58/X559/rs6dO+vBBx/UJZdcYixfcv9ncKb5F5NXTjt27PD/bt10003Gcuvmd+7c2dhYt5GtHd977z199dVX6tmzpzp27KjQ0FATxyZJev311+X1elVRUaEFCxYoISFBCQkJxvK3bNmiJUuWuDYYX/dNFxISorZt2youLk5hYWEB55eWlvonc9atW6fhw4cb/cV0HEc5OTlq166d9u/fr549exrLnjJlilJSUozlnYmb703fax8cHKyXX37Z+GsvSQUFBSorK/OfJUZERBjJPXTo0Fm/1rFjRyPfQ5KWLVumW2+91WimT1RUlKKjozVs2DDjJ0rSqT9IO3bs8F/1SWYmkQMeXli4cKFycnKUlZWlkJAQLV++3H95a0JqaqqWL1+uyZMn6+2339bdd99ttHSff/55rVu3TgkJCZowYYKio6ONlm55ebk6dOigXr16ad++fUpPT1eLFi30xz/+UUuXLg04//7771dUVJS2bt2qLl26KDk5Wc8995yBIz9l+vTpatu2rSZMmKCNGzdq06ZNevjhh41kV1RUKCMjQx07dnRlzNvt9+b999+v6OhobdmyxZXXPikpSR988IFatmzpv8pYu3atkeyzraDxeDxGV3i0a9dOTz/9tL755hv16dNHAwYM8I9TB2r58uX661//qrvuuktdu3bViBEjdN111xnJlqQJEyaodevWateunSSddUXMfy3Qmbhf//rXjuM4/pnbESNGBBpZS1xcnFNQUOBMnDjRcRzHGT58uNH8O++803Ecx78qwvf/Y8pdd91V6/OxY8ca/T5xcXG1VnWYnkG/4447an1u8vUZPHiw079/f//HTTfdZCzbcey8N71erzN69Oha38eUESNGOF6v12jm/8f06h3HcZyqqirn/fffd2JiYpwf//jHxvOPHDni/OEPf3AiIyON5pr+efoEfKZbXV2t8vJyeTweVVdXq0EDs/dbtG/fXtHR0UpKStKiRYuMXt5KpwbLp0yZ4tpgfHFxsbKystS5c2dlZWWppKREx44dM7bYurKyUqmpqerRo4f+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paUay3Z4vSUxMVJ8+fRQZGandu3frgw8+0J///OeAcwMu3bfeeku/+MUvjC/HqXkXSF1u3IOOMxs9erQuv/xyZWZmKjQ0VA0bNgz4pg6v16vc3FwlJydr+vTptb5mcqLo/fff1w033GAs70xKSkoUGhqqHTt26Cc/+Yl/8yETCgoKtHPnTr3zzjv66quvFBkZafzK4+6771ZqaqrRzJri4+O1atWqs34eiLorL1588UUjpehz4sQJLV682H8b9rhx44xMxJ7z8MLixYs1YcIEvfbaa9q8eXOtr5mYgfbdkus7A6rJ1L3/9Znv9Z88efJpr4/pFQCzZs3StGnTNGfOHMXFxQWc16BBA7Vt21bLly83cHRnt2jRIldKNyUl5YyTinv37g1ok6G6fvOb3+iWW25RYmKiunbtaiy3pr59+2rNmjW1JngjIyON5Tdu3FgrV670ny2aXD3i1nxJzVukY2Ji/B1UUFBwfkvXt7mE6Ykbn7feekuSu/f+12e+179///6nbaRtWnl5uf/+f7d26HeDx+PRxIkTa00CmihF37rQvLw8hYaGqmnTplq4cKHuvvvugLNrWr9+vdG8M/n4449VUVGh3bt3Szr1mpks3QULFmjx4sV68skn1alTJ6M3MLg1X3K2MeOKigojw18BDy+4velEcnKy/97/Rx99VB6Px9i9/xcCt9cZb9myRVlZWZJOjaH16tVLTz75pLF8N51pB7ZAdl6r64477tC8efPUpUsXffnll5o6daora1zdNGbMGL3wwguu5fuuyHxSUlI0ZcoUI9luzZf4uDVmHPDqBbc3nThw4IBmzZolSXrkkUeMXN5eSNzeSNvj8eiVV15R06ZNddFFFykqKspovpuGDBmi9PT0WpOAJgUHB/svyzt06GB8XsOGrl27avPmzbX2uzWxI1haWppeeeUVZWVlaceOHZJOjeVXVlYaK93GjRv77x6dOnWqkcyafGvsa44ZmxBw6YaHhyshIUG//OUvtWDBAo0fP14fffSRiWOT5O69/xcCtzfSXrx4sdLS0tSyZUvl5+crMTHR+F1vbrnnnntUWVmp3NxcVVdXq3Xr1ho8eLCx/IiICC1cuFDXXHON9u/fr9atWxvLti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AAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.heatmap(data.isnull(),yticklabels=False,cbar=False,cmap='rainbow')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4273dadc",
   "metadata": {},
   "source": [
    "#### （3）embarked其实是embark_town的缩写所以表达重复，删掉一个"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 325,
   "id": "558905f6",
   "metadata": {},
   "outputs": [],
   "source": [
    "data.drop('embark_town',axis=1,inplace=True)#inplace if False, return a copy. Otherwise, do operation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 326,
   "id": "e678d1eb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>adult_male</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>Second</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>24.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>23.4500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>32.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>Q</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass     sex   age  sibsp  parch     fare embarked   class  \\\n",
       "0           0       3    male  22.0      1      0   7.2500        S   Third   \n",
       "1           1       1  female  38.0      1      0  71.2833        C   First   \n",
       "2           1       3  female  26.0      0      0   7.9250        S   Third   \n",
       "3           1       1  female  35.0      1      0  53.1000        S   First   \n",
       "4           0       3    male  35.0      0      0   8.0500        S   Third   \n",
       "..        ...     ...     ...   ...    ...    ...      ...      ...     ...   \n",
       "886         0       2    male  27.0      0      0  13.0000        S  Second   \n",
       "887         1       1  female  19.0      0      0  30.0000        S   First   \n",
       "888         0       3  female  24.0      1      2  23.4500        S   Third   \n",
       "889         1       1    male  26.0      0      0  30.0000        C   First   \n",
       "890         0       3    male  32.0      0      0   7.7500        Q   Third   \n",
       "\n",
       "       who  adult_male alive  alone  \n",
       "0      man        True    no  False  \n",
       "1    woman       False   yes  False  \n",
       "2    woman       False   yes   True  \n",
       "3    woman       False   yes  False  \n",
       "4      man        True    no   True  \n",
       "..     ...         ...   ...    ...  \n",
       "886    man        True    no   True  \n",
       "887  woman       False   yes   True  \n",
       "888  woman       False    no  False  \n",
       "889    man        True   yes   True  \n",
       "890    man        True    no   True  \n",
       "\n",
       "[891 rows x 13 columns]"
      ]
     },
     "execution_count": 326,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 327,
   "id": "54aca715",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 327,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAAEgCAYAAAAXNKCoAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAZ9klEQVR4nO3de3iP9/3H8ddXRGoOcYggxClUy8VsTebaRS9jjC2OSYktccw2x25zuDqmQtWZ2NZmZLam6lx60VEz6lDKStXqMJWyOJU2kjSCxCGR7/37w+/7nVBtN5/7E7Hn47pcl8h1fd633Hde3/v+nG6P4ziOAABWlCvtAwCA/yWELgBYROgCgEWELgBYROgCgEWELgBYVP7LvvmCx9ZhAMCjY8qXTMTlThcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQhcALCJ0AcAiQ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q5cOVWrVk3S7cfkSpUqle4BPeT69+8vSXr77bf9b1jo2bOna685Kuu40wXu0qBBAyUnJysvL0+LFy9mju7XdOnSJf+MhYyMDOXn55fyET2cGEgD7nLr1i2tXbtWJ06cUJMmTRQXF8fsha/h4MGDmj17ti5evKiQkBDNmjVLzZs3L+3DeugQugCMWLVqlZYsWeJ/kWf58uX9Wz3i3+heAGDE2rVrtWzZMnXo0EGzZs3y76eLkghdAEZUr15doaGhKigoUNu2bXX58uXSPqSHEqELwIgqVapo27Zt/r0qcnNzS/uQHkr06QIwIj8/X+fOnVNISIjS0tLUsWNHtW3btrQP66FD6AKARXQvAIBFhC4AWEToAoBFhC4AWEToAoBF/wd/hP/QuVj6ZgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.heatmap(data.isnull(),yticklabels=False,cbar=False,cmap='rainbow')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d1f7501e",
   "metadata": {},
   "source": [
    "#### (4)处理embarked缺失值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 328,
   "id": "a58b881e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 328,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[\"embarked\"].isnull().sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "94d4cd9e",
   "metadata": {},
   "source": [
    "#### 因为缺失数量很小，可以忽略不计，通过后面使用虚拟变量替换时，自动填充。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ec67472d",
   "metadata": {},
   "source": [
    "### Step5：数据类别转换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 329,
   "id": "d65b32c6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 891 entries, 0 to 890\n",
      "Data columns (total 13 columns):\n",
      " #   Column      Non-Null Count  Dtype  \n",
      "---  ------      --------------  -----  \n",
      " 0   survived    891 non-null    int64  \n",
      " 1   pclass      891 non-null    int64  \n",
      " 2   sex         891 non-null    object \n",
      " 3   age         891 non-null    float64\n",
      " 4   sibsp       891 non-null    int64  \n",
      " 5   parch       891 non-null    int64  \n",
      " 6   fare        891 non-null    float64\n",
      " 7   embarked    889 non-null    object \n",
      " 8   class       891 non-null    object \n",
      " 9   who         891 non-null    object \n",
      " 10  adult_male  891 non-null    bool   \n",
      " 11  alive       891 non-null    object \n",
      " 12  alone       891 non-null    bool   \n",
      "dtypes: bool(2), float64(2), int64(4), object(5)\n",
      "memory usage: 78.4+ KB\n"
     ]
    }
   ],
   "source": [
    "data.info()\n",
    "#类似于name这种敏感信息一般是对分析数据无意的，所以项目中一般会进行脱敏处理或者直接忽视"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "47c5310c",
   "metadata": {},
   "source": [
    "在data中主要有两种不同的数据类型，一种是数字型（Number）,一种是对象（object）。前者主要是整数或者浮点数，可直接用来计算，而后者一般为字符串，不适合数值计算，需要通过虚拟变量替换手段将字符改变为数字表示。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2e6b3be9",
   "metadata": {},
   "source": [
    "主要有以下五种object列：\n",
    "\n",
    "sex\n",
    "\n",
    "embarked（含有缺失值）\n",
    "\n",
    "class\n",
    "\n",
    "who\n",
    "\n",
    "alone\n",
    "\n",
    "alive\n",
    "\n",
    "还有bool类型的adult_male、alone后续也将处理"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0701c0e1",
   "metadata": {},
   "source": [
    "#### （1）处理sex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 330,
   "id": "0002d908",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "male      577\n",
       "female    314\n",
       "Name: sex, dtype: int64"
      ]
     },
     "execution_count": 330,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['sex'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 331,
   "id": "51ff4394",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>female</th>\n",
       "      <th>male</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     female  male\n",
       "0         0     1\n",
       "1         1     0\n",
       "2         1     0\n",
       "3         1     0\n",
       "4         0     1\n",
       "..      ...   ...\n",
       "886       0     1\n",
       "887       1     0\n",
       "888       1     0\n",
       "889       0     1\n",
       "890       0     1\n",
       "\n",
       "[891 rows x 2 columns]"
      ]
     },
     "execution_count": 331,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.get_dummies(data['sex'])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "50862a58",
   "metadata": {},
   "source": [
    "get_dummies函数是Python的pandas库中的一个函数，用于将分类变量转换为虚拟/指示变量。它的主要作用是将类别变量转换为0和1的形式，以便于进行机器学习模型的训练。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5c7a28ec",
   "metadata": {},
   "source": [
    "因为female和male是sex的两种不同的属性，且当一个为真时，另一个一定为假，所以不存在00或11的情况，只存在01或10情况，所以只需要一个bit位就能表示sex的男女了，如1表示男，0表示女。\n",
    "\n",
    "那么，便可以通过调整get_dummies()函数里的参数来控制变量的多少。（drop_first=True）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 332,
   "id": "d0e955df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>male</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     male\n",
       "0       1\n",
       "1       0\n",
       "2       0\n",
       "3       0\n",
       "4       1\n",
       "..    ...\n",
       "886     1\n",
       "887     0\n",
       "888     0\n",
       "889     1\n",
       "890     1\n",
       "\n",
       "[891 rows x 1 columns]"
      ]
     },
     "execution_count": 332,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.get_dummies(data['sex'],drop_first=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 333,
   "id": "a85cbb02",
   "metadata": {},
   "outputs": [],
   "source": [
    "sex = pd.get_dummies(data['sex'],drop_first=True)#用变量将转换完的sex列存储起来"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 334,
   "id": "d142a241",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>male</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     male\n",
       "0       1\n",
       "1       0\n",
       "2       0\n",
       "3       0\n",
       "4       1\n",
       "..    ...\n",
       "886     1\n",
       "887     0\n",
       "888     0\n",
       "889     1\n",
       "890     1\n",
       "\n",
       "[891 rows x 1 columns]"
      ]
     },
     "execution_count": 334,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sex"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c939a55c",
   "metadata": {},
   "source": [
    "#### （2）处理embarked"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 335,
   "id": "1ba58bb1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>adult_male</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>829</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>62.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass     sex   age  sibsp  parch  fare embarked  class  \\\n",
       "61          1       1  female  38.0      0      0  80.0      NaN  First   \n",
       "829         1       1  female  62.0      0      0  80.0      NaN  First   \n",
       "\n",
       "       who  adult_male alive  alone  \n",
       "61   woman       False   yes   True  \n",
       "829  woman       False   yes   True  "
      ]
     },
     "execution_count": 335,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[data['embarked'].isna()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 336,
   "id": "191eec65",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "S    644\n",
       "C    168\n",
       "Q     77\n",
       "Name: embarked, dtype: int64"
      ]
     },
     "execution_count": 336,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['embarked'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 337,
   "id": "d6f43528",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "889\n"
     ]
    }
   ],
   "source": [
    "print(644+168+77)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 338,
   "id": "64d2425b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['S', 'C', 'Q', nan], dtype=object)"
      ]
     },
     "execution_count": 338,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['embarked'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 339,
   "id": "19379a53",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>C</th>\n",
       "      <th>Q</th>\n",
       "      <th>S</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     C  Q  S\n",
       "0    0  0  1\n",
       "1    1  0  0\n",
       "2    0  0  1\n",
       "3    0  0  1\n",
       "4    0  0  1\n",
       "..  .. .. ..\n",
       "886  0  0  1\n",
       "887  0  0  1\n",
       "888  0  0  1\n",
       "889  1  0  0\n",
       "890  0  1  0\n",
       "\n",
       "[891 rows x 3 columns]"
      ]
     },
     "execution_count": 339,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.get_dummies(data['embarked'])#用同样的方式替换变量，发现nan值直接忽略了，因为本身nan值的个数只有两个，所以关系不大，不用考虑"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 340,
   "id": "b83478b7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Q</th>\n",
       "      <th>S</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Q  S\n",
       "0    0  1\n",
       "1    0  0\n",
       "2    0  1\n",
       "3    0  1\n",
       "4    0  1\n",
       "..  .. ..\n",
       "886  0  1\n",
       "887  0  1\n",
       "888  0  1\n",
       "889  0  0\n",
       "890  1  0\n",
       "\n",
       "[891 rows x 2 columns]"
      ]
     },
     "execution_count": 340,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#同理，因为三种结果是互斥的，只要用两个bit位就能表示出三种不同结果了如C:00、S:01、Q:10\n",
    "pd.get_dummies(data['embarked'],drop_first=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 341,
   "id": "c355f7dc",
   "metadata": {},
   "outputs": [],
   "source": [
    "embark = pd.get_dummies(data['embarked'],drop_first=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 342,
   "id": "633948d0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Q  S\n",
       "0  1    644\n",
       "   0    170\n",
       "1  0     77\n",
       "dtype: int64"
      ]
     },
     "execution_count": 342,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "embark.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 343,
   "id": "f402bf94",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "891\n"
     ]
    }
   ],
   "source": [
    "print(644+170+77)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8ee70a70",
   "metadata": {},
   "source": [
    "#### 可以和之前的embark进行数据对比发现，Nan值已经被归入了C:00中。（自动补充）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1ccc022e",
   "metadata": {},
   "source": [
    "#### （3） 处理class"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 348,
   "id": "dbda4d84",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Second</th>\n",
       "      <th>Third</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Second  Third\n",
       "0         0      1\n",
       "1         0      0\n",
       "2         0      1\n",
       "3         0      0\n",
       "4         0      1\n",
       "..      ...    ...\n",
       "886       1      0\n",
       "887       0      0\n",
       "888       0      1\n",
       "889       0      0\n",
       "890       0      1\n",
       "\n",
       "[891 rows x 2 columns]"
      ]
     },
     "execution_count": 348,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "class_ = embark = pd.get_dummies(data['class'],drop_first=True)\n",
    "class_#00_1, 10_2, 01_3"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb6da321",
   "metadata": {},
   "source": [
    "#### （4） 处理who"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 352,
   "id": "adf80165",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "man      537\n",
       "woman    271\n",
       "child     83\n",
       "Name: who, dtype: int64"
      ]
     },
     "execution_count": 352,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[\"who\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 353,
   "id": "d5500a5f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>man</th>\n",
       "      <th>woman</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     man  woman\n",
       "0      1      0\n",
       "1      0      1\n",
       "2      0      1\n",
       "3      0      1\n",
       "4      1      0\n",
       "..   ...    ...\n",
       "886    1      0\n",
       "887    0      1\n",
       "888    0      1\n",
       "889    1      0\n",
       "890    1      0\n",
       "\n",
       "[891 rows x 2 columns]"
      ]
     },
     "execution_count": 353,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "who = embark = pd.get_dummies(data['who'],drop_first=True)\n",
    "who"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3cf094e5",
   "metadata": {},
   "source": [
    "#### （5） 处理alone"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 356,
   "id": "03340d90",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True     537\n",
       "False    354\n",
       "Name: alone, dtype: int64"
      ]
     },
     "execution_count": 356,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[\"alone\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 357,
   "id": "69d9b170",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>True</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     True\n",
       "0       0\n",
       "1       0\n",
       "2       1\n",
       "3       0\n",
       "4       1\n",
       "..    ...\n",
       "886     1\n",
       "887     1\n",
       "888     0\n",
       "889     1\n",
       "890     1\n",
       "\n",
       "[891 rows x 1 columns]"
      ]
     },
     "execution_count": 357,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alone = pd.get_dummies(data['alone'],drop_first=True)\n",
    "alone"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0e5bdeba",
   "metadata": {},
   "source": [
    "#### (6)处理adult_male"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 360,
   "id": "ce495edb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True     537\n",
       "False    354\n",
       "Name: adult_male, dtype: int64"
      ]
     },
     "execution_count": 360,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[\"adult_male\"].value_counts()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f7a4b231",
   "metadata": {},
   "source": [
    "因为who里面已经有值表示child的了，所以这里默认把非child的值当成adult_male，因此把此列当做冗余列删除掉。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 364,
   "id": "d154359d",
   "metadata": {},
   "outputs": [],
   "source": [
    "data.drop('adult_male',axis=1,inplace=True)#inplace if False, return a copy. Otherwise, do operation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 365,
   "id": "24f78bc7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>Second</td>\n",
       "      <td>man</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>24.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>23.4500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>man</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>32.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>Q</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass     sex   age  sibsp  parch     fare embarked   class  \\\n",
       "0           0       3    male  22.0      1      0   7.2500        S   Third   \n",
       "1           1       1  female  38.0      1      0  71.2833        C   First   \n",
       "2           1       3  female  26.0      0      0   7.9250        S   Third   \n",
       "3           1       1  female  35.0      1      0  53.1000        S   First   \n",
       "4           0       3    male  35.0      0      0   8.0500        S   Third   \n",
       "..        ...     ...     ...   ...    ...    ...      ...      ...     ...   \n",
       "886         0       2    male  27.0      0      0  13.0000        S  Second   \n",
       "887         1       1  female  19.0      0      0  30.0000        S   First   \n",
       "888         0       3  female  24.0      1      2  23.4500        S   Third   \n",
       "889         1       1    male  26.0      0      0  30.0000        C   First   \n",
       "890         0       3    male  32.0      0      0   7.7500        Q   Third   \n",
       "\n",
       "       who alive  alone  \n",
       "0      man    no  False  \n",
       "1    woman   yes  False  \n",
       "2    woman   yes   True  \n",
       "3    woman   yes  False  \n",
       "4      man    no   True  \n",
       "..     ...   ...    ...  \n",
       "886    man    no   True  \n",
       "887  woman   yes   True  \n",
       "888  woman    no  False  \n",
       "889    man   yes   True  \n",
       "890    man    no   True  \n",
       "\n",
       "[891 rows x 12 columns]"
      ]
     },
     "execution_count": 365,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "523bc9b8",
   "metadata": {},
   "source": [
    "#### (7)处理alive"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 373,
   "id": "6f9ade9c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "no     549\n",
       "yes    342\n",
       "Name: alive, dtype: int64"
      ]
     },
     "execution_count": 373,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[\"alive\"].value_counts()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "31ab1ddd",
   "metadata": {},
   "source": [
    "因为alive和survived表达重复，故删除。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 374,
   "id": "d8db02ff",
   "metadata": {},
   "outputs": [],
   "source": [
    "data.drop('alive',axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 375,
   "id": "ce171ec4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>alone</th>\n",
       "      <th>male</th>\n",
       "      <th>man</th>\n",
       "      <th>woman</th>\n",
       "      <th>Second</th>\n",
       "      <th>Third</th>\n",
       "      <th>man</th>\n",
       "      <th>woman</th>\n",
       "      <th>True</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>False</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>True</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>Second</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>True</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>24.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>23.4500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>32.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>Q</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 19 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass     sex   age  sibsp  parch     fare embarked   class  \\\n",
       "0           0       3    male  22.0      1      0   7.2500        S   Third   \n",
       "1           1       1  female  38.0      1      0  71.2833        C   First   \n",
       "2           1       3  female  26.0      0      0   7.9250        S   Third   \n",
       "3           1       1  female  35.0      1      0  53.1000        S   First   \n",
       "4           0       3    male  35.0      0      0   8.0500        S   Third   \n",
       "..        ...     ...     ...   ...    ...    ...      ...      ...     ...   \n",
       "886         0       2    male  27.0      0      0  13.0000        S  Second   \n",
       "887         1       1  female  19.0      0      0  30.0000        S   First   \n",
       "888         0       3  female  24.0      1      2  23.4500        S   Third   \n",
       "889         1       1    male  26.0      0      0  30.0000        C   First   \n",
       "890         0       3    male  32.0      0      0   7.7500        Q   Third   \n",
       "\n",
       "       who  alone  male  man  woman  Second  Third  man  woman  True  \n",
       "0      man  False     1    1      0       0      1    1      0     0  \n",
       "1    woman  False     0    0      1       0      0    0      1     0  \n",
       "2    woman   True     0    0      1       0      1    0      1     1  \n",
       "3    woman  False     0    0      1       0      0    0      1     0  \n",
       "4      man   True     1    1      0       0      1    1      0     1  \n",
       "..     ...    ...   ...  ...    ...     ...    ...  ...    ...   ...  \n",
       "886    man   True     1    1      0       1      0    1      0     1  \n",
       "887  woman   True     0    0      1       0      0    0      1     1  \n",
       "888  woman  False     0    0      1       0      1    0      1     0  \n",
       "889    man   True     1    1      0       0      0    1      0     1  \n",
       "890    man   True     1    1      0       0      1    1      0     1  \n",
       "\n",
       "[891 rows x 19 columns]"
      ]
     },
     "execution_count": 375,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "344f5f5a",
   "metadata": {},
   "source": [
    "#### (8)将转换成数字的变量拼接在data中并删除object型变量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 368,
   "id": "2404acb0",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.concat([data,sex,embark,class_,who,alone],axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 369,
   "id": "21f800e3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "      <th>male</th>\n",
       "      <th>man</th>\n",
       "      <th>woman</th>\n",
       "      <th>Second</th>\n",
       "      <th>Third</th>\n",
       "      <th>man</th>\n",
       "      <th>woman</th>\n",
       "      <th>True</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>Second</td>\n",
       "      <td>man</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>24.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>23.4500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>man</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>32.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>Q</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 20 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass     sex   age  sibsp  parch     fare embarked   class  \\\n",
       "0           0       3    male  22.0      1      0   7.2500        S   Third   \n",
       "1           1       1  female  38.0      1      0  71.2833        C   First   \n",
       "2           1       3  female  26.0      0      0   7.9250        S   Third   \n",
       "3           1       1  female  35.0      1      0  53.1000        S   First   \n",
       "4           0       3    male  35.0      0      0   8.0500        S   Third   \n",
       "..        ...     ...     ...   ...    ...    ...      ...      ...     ...   \n",
       "886         0       2    male  27.0      0      0  13.0000        S  Second   \n",
       "887         1       1  female  19.0      0      0  30.0000        S   First   \n",
       "888         0       3  female  24.0      1      2  23.4500        S   Third   \n",
       "889         1       1    male  26.0      0      0  30.0000        C   First   \n",
       "890         0       3    male  32.0      0      0   7.7500        Q   Third   \n",
       "\n",
       "       who alive  alone  male  man  woman  Second  Third  man  woman  True  \n",
       "0      man    no  False     1    1      0       0      1    1      0     0  \n",
       "1    woman   yes  False     0    0      1       0      0    0      1     0  \n",
       "2    woman   yes   True     0    0      1       0      1    0      1     1  \n",
       "3    woman   yes  False     0    0      1       0      0    0      1     0  \n",
       "4      man    no   True     1    1      0       0      1    1      0     1  \n",
       "..     ...   ...    ...   ...  ...    ...     ...    ...  ...    ...   ...  \n",
       "886    man    no   True     1    1      0       1      0    1      0     1  \n",
       "887  woman   yes   True     0    0      1       0      0    0      1     1  \n",
       "888  woman    no  False     0    0      1       0      1    0      1     0  \n",
       "889    man   yes   True     1    1      0       0      0    1      0     1  \n",
       "890    man    no   True     1    1      0       0      1    1      0     1  \n",
       "\n",
       "[891 rows x 20 columns]"
      ]
     },
     "execution_count": 369,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 376,
   "id": "9abb2c87",
   "metadata": {},
   "outputs": [],
   "source": [
    "data.drop(['sex','embarked','class','who','alone'],axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 377,
   "id": "a0ee67d6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>male</th>\n",
       "      <th>man</th>\n",
       "      <th>woman</th>\n",
       "      <th>Second</th>\n",
       "      <th>Third</th>\n",
       "      <th>man</th>\n",
       "      <th>woman</th>\n",
       "      <th>True</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>24.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>23.4500</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>32.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     survived  pclass   age  sibsp  parch     fare  male  man  woman  Second  \\\n",
       "0           0       3  22.0      1      0   7.2500     1    1      0       0   \n",
       "1           1       1  38.0      1      0  71.2833     0    0      1       0   \n",
       "2           1       3  26.0      0      0   7.9250     0    0      1       0   \n",
       "3           1       1  35.0      1      0  53.1000     0    0      1       0   \n",
       "4           0       3  35.0      0      0   8.0500     1    1      0       0   \n",
       "..        ...     ...   ...    ...    ...      ...   ...  ...    ...     ...   \n",
       "886         0       2  27.0      0      0  13.0000     1    1      0       1   \n",
       "887         1       1  19.0      0      0  30.0000     0    0      1       0   \n",
       "888         0       3  24.0      1      2  23.4500     0    0      1       0   \n",
       "889         1       1  26.0      0      0  30.0000     1    1      0       0   \n",
       "890         0       3  32.0      0      0   7.7500     1    1      0       0   \n",
       "\n",
       "     Third  man  woman  True  \n",
       "0        1    1      0     0  \n",
       "1        0    0      1     0  \n",
       "2        1    0      1     1  \n",
       "3        0    0      1     0  \n",
       "4        1    1      0     1  \n",
       "..     ...  ...    ...   ...  \n",
       "886      0    1      0     1  \n",
       "887      0    0      1     1  \n",
       "888      1    0      1     0  \n",
       "889      0    1      0     1  \n",
       "890      1    1      0     1  \n",
       "\n",
       "[891 rows x 14 columns]"
      ]
     },
     "execution_count": 377,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data#全是数字"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5cbfabb4",
   "metadata": {},
   "source": [
    "#### **注：如果数据中还含有一些如手机号、身份证号码、姓名等敏感信息，则需要进行脱敏处理，如：只有不影响数据整体分析则直接可以drop。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "895abc5a",
   "metadata": {},
   "source": [
    "### Step6：数据建模"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b9075397",
   "metadata": {},
   "source": [
    "#### （1）划分特征变量（自变量\\独立变量）与响应变量（因变量\\依赖变量）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 383,
   "id": "a0b1c215",
   "metadata": {},
   "outputs": [],
   "source": [
    "X=data.drop('survived',axis=1)#X--特征集：除了survived列外的其他列都作为特征"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 384,
   "id": "68caf1d0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pclass</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>male</th>\n",
       "      <th>man</th>\n",
       "      <th>woman</th>\n",
       "      <th>Second</th>\n",
       "      <th>Third</th>\n",
       "      <th>man</th>\n",
       "      <th>woman</th>\n",
       "      <th>True</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>2</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>1</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>3</td>\n",
       "      <td>24.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>23.4500</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>3</td>\n",
       "      <td>32.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     pclass   age  sibsp  parch     fare  male  man  woman  Second  Third  \\\n",
       "0         3  22.0      1      0   7.2500     1    1      0       0      1   \n",
       "1         1  38.0      1      0  71.2833     0    0      1       0      0   \n",
       "2         3  26.0      0      0   7.9250     0    0      1       0      1   \n",
       "3         1  35.0      1      0  53.1000     0    0      1       0      0   \n",
       "4         3  35.0      0      0   8.0500     1    1      0       0      1   \n",
       "..      ...   ...    ...    ...      ...   ...  ...    ...     ...    ...   \n",
       "886       2  27.0      0      0  13.0000     1    1      0       1      0   \n",
       "887       1  19.0      0      0  30.0000     0    0      1       0      0   \n",
       "888       3  24.0      1      2  23.4500     0    0      1       0      1   \n",
       "889       1  26.0      0      0  30.0000     1    1      0       0      0   \n",
       "890       3  32.0      0      0   7.7500     1    1      0       0      1   \n",
       "\n",
       "     man  woman  True  \n",
       "0      1      0     0  \n",
       "1      0      1     0  \n",
       "2      0      1     1  \n",
       "3      0      1     0  \n",
       "4      1      0     1  \n",
       "..   ...    ...   ...  \n",
       "886    1      0     1  \n",
       "887    0      1     1  \n",
       "888    0      1     0  \n",
       "889    1      0     1  \n",
       "890    1      0     1  \n",
       "\n",
       "[891 rows x 13 columns]"
      ]
     },
     "execution_count": 384,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 385,
   "id": "d13be2eb",
   "metadata": {},
   "outputs": [],
   "source": [
    "#响应列集\n",
    "y=data['survived']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 386,
   "id": "5f2396b6",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      0\n",
       "1      1\n",
       "2      1\n",
       "3      1\n",
       "4      0\n",
       "      ..\n",
       "886    0\n",
       "887    1\n",
       "888    0\n",
       "889    1\n",
       "890    0\n",
       "Name: survived, Length: 891, dtype: int64"
      ]
     },
     "execution_count": 386,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "89d229e2",
   "metadata": {},
   "source": [
    "#### （2）划分训练集与测试集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 389,
   "id": "9e541ede",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 390,
   "id": "8db25518",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30, random_state=0)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5b62e2ed",
   "metadata": {},
   "source": [
    "#### （3）训练模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 397,
   "id": "5c42a07b",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 398,
   "id": "582ed296",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\_logistic.py:763: ConvergenceWarning: lbfgs failed to converge (status=1):\n",
      "STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.\n",
      "\n",
      "Increase the number of iterations (max_iter) or scale the data as shown in:\n",
      "    https://scikit-learn.org/stable/modules/preprocessing.html\n",
      "Please also refer to the documentation for alternative solver options:\n",
      "    https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression\n",
      "  n_iter_i = _check_optimize_result(\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "LogisticRegression()"
      ]
     },
     "execution_count": 398,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "logitmodel = LogisticRegression()\n",
    "logitmodel.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 399,
   "id": "61ffa02a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression(max_iter=1000)"
      ]
     },
     "execution_count": 399,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Increase the number of iterations (max_iter) or scale the data\n",
    "#增加迭代次数或者缩放数据\n",
    "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
    "                   intercept_scaling=1, l1_ratio=None, max_iter=1000,\n",
    "                   multi_class='auto', n_jobs=None, penalty='l2',\n",
    "                   random_state=None, solver='lbfgs', tol=0.0001, verbose=0,\n",
    "                   warm_start=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 400,
   "id": "7c701a78",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(268,)"
      ]
     },
     "execution_count": 400,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_test.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c8f65271",
   "metadata": {},
   "source": [
    "### Step7：模型预测"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 413,
   "id": "3cceab77",
   "metadata": {},
   "outputs": [],
   "source": [
    "y_predictions = logitmodel.predict(X_test)#获取预测结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 446,
   "id": "eaba1a48",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\n"
     ]
    }
   ],
   "source": [
    "#survived:pclass\tage\tsibsp\tparch\tfare\tmale\tman\twoman\tSecond\tThird\tman\twoman\tTrue\n",
    "\n",
    "#0:3\t22.0\t1\t0\t7.2500\t1\t1\t0\t0\t1\t1\t0\t0\n",
    "#1:1\t38.0\t1\t0\t71.2833\t0\t0\t1\t0\t0\t0\t1\t0\n",
    "\n",
    "print(logitmodel.predict([[3,22.0,1,0,7.2500,1,1,0,0,1,1,0,0]]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 447,
   "id": "5b0544e5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1]\n"
     ]
    }
   ],
   "source": [
    "print(logitmodel.predict([[1,38.0,1,0,71.2833,0,0,1,0,0,0,1,0]]))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d9dcd411",
   "metadata": {},
   "source": [
    "### Step8：模型评估"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ba1af2b4",
   "metadata": {},
   "source": [
    "#### （1）混淆矩阵"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 403,
   "id": "ee9aa000",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import confusion_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 404,
   "id": "bb5998f0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[145,  23],\n",
       "       [ 27,  73]], dtype=int64)"
      ]
     },
     "execution_count": 404,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "confusion_matrix(y_test,y_predictions)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "67aa23d7",
   "metadata": {},
   "source": [
    "#### （2）查看准确度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 406,
   "id": "fdeb1252",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import accuracy_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 407,
   "id": "18009057",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8134328358208955"
      ]
     },
     "execution_count": 407,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "accuracy=accuracy_score(y_test,y_predictions)\n",
    "accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 408,
   "id": "13dace92",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1,\n",
       "       0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,\n",
       "       1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1,\n",
       "       1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1,\n",
       "       0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,\n",
       "       0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0,\n",
       "       1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0,\n",
       "       1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1,\n",
       "       0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1,\n",
       "       0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1,\n",
       "       0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 1, 0], dtype=int64)"
      ]
     },
     "execution_count": 408,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_predictions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 412,
   "id": "65cc912e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1,\n",
       "       0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,\n",
       "       1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0,\n",
       "       1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1,\n",
       "       1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1,\n",
       "       0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0,\n",
       "       1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0,\n",
       "       1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1,\n",
       "       1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1,\n",
       "       0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1,\n",
       "       0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0,\n",
       "       0, 0, 1, 0], dtype=int64)"
      ]
     },
     "execution_count": 412,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr = np.array(y_test)\n",
    "arr"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "126e90b6",
   "metadata": {},
   "source": [
    "#### （3）获取模型评估报告"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 415,
   "id": "bf92952c",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import classification_report"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 416,
   "id": "7f6c5269",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              precision    recall  f1-score   support\n",
      "\n",
      "           0       0.84      0.86      0.85       168\n",
      "           1       0.76      0.73      0.74       100\n",
      "\n",
      "    accuracy                           0.81       268\n",
      "   macro avg       0.80      0.80      0.80       268\n",
      "weighted avg       0.81      0.81      0.81       268\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(classification_report(y_test,y_predictions))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2565f096",
   "metadata": {},
   "source": [
    "这个模型的评估报告包含了以下几个指标：\n",
    "\n",
    "1. 准确率（accuracy）：0.81，表示模型在所有样本中正确分类的比例为81%。\n",
    "2. 精确率（precision）：对于正例（label为1），精确率为0.76；对于负例（label为0），精确率为0.84。精确率表示模型预测为正例的样本中真正为正例的比例。\n",
    "3. 召回率（recall）：对于正例（label为1），召回率为0.73；对于负例（label为0），召回率为0.86。召回率表示模型预测出的正例占实际正例的比例。\n",
    "4. F1-score：F1-score是精确率和召回率的调和平均值，用于综合评价模型的性能。对于正例（label为1），F1-score为0.74；对于负例（label为0），F1-score为0.85。\n",
    "5. 支持度（support）：表示每个类别的样本数量，分别为168和100。\n",
    "\n",
    "从报告中可以看出，模型的整体性能较好，准确率达到了81%。在正例和负例的分类任务中，精确率和召回率也相对较高。但是，对于负例的分类性能略优于正例。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 420,
   "id": "6c5d2360",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[145,  23],\n",
       "       [ 27,  73]], dtype=int64)"
      ]
     },
     "execution_count": 420,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "confusion_matrix(y_test,y_predictions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d3a00046",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
